Pointer in c++for scanning an array : <p>How to scan an array in c++ using pointer?</p>

<p>I have learned c programming .so i tried that way.</p>

<pre><code>include&lt;iostream&gt;
using namespace std;
main()
{
int a[5],*p,i;
p=&amp;a[5];
for(i=0;i&lt;5;i++)
{
cout&lt;&lt;"enter"&lt;&lt;i+1&lt;&lt;endl;
cin&gt;&gt;(p+i);

}
for(i=0;i&lt;5;i++)
{
cout&lt;&lt;*(p+i)&lt;&lt;endl;
}
}
</code></pre>

<p>I am expecting to  scan using pointer just like in c programming</p>
