Im looking for ways to use arrays using pointers.
an ex is:
#include<iostream.h>
#include<conio.h>
void main ()
{
int sales[7]= {1,2,3,4,5,6,7}
int*p=&sales[0];
int x;
//-----------------------------
for(x=0; x<7; ++x)
cout<<"$"<<sales[x]<<" ";
cout<<endl;
//-----------------------------
for(x=0; x<7; ++x)
cout<<"$"<<p[x]<<" ";
cout<<endl;
//-----------------------------
for(x=0; x<7; ++x)
cout<<"$"<<*(sales+x<<" ";
cout<<endl;
//-----------------------------
for(x=0; x<7; ++x)
cout<<"$"<<*(p+x)<< " ";
cout<<endl;
getch();
}
\\ all of the above give the same result
\\$1 $2 $3 $4 $5 $6 $7
any more ways???????
at least I need 10 more ways
any feed back is greatly accepted