#include<iostream.h>
main()
{
int a[5];
int *pt;
pt=a;
*pt=a[0]=10;
pt++;
*pt=a[1]=20;
pt++;
*pt=a[2]=30;
pt++;
*pt=a[3]=40;
pt++;
*pt=a[4]=50;
pt++;
for ( int i=0;i!=5;i++)
{
cout<<a[i]<<"\n";
}
}
Thursday, 20 March 2014
Passing Pointer to an Array
15:33
No comments
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment