How can I print the array backwards with the pointer already there?
instead of it printing out 1,2,3,4,5,6,7,8,9,10
I can't figure out how to print it out backwards. 10 through 1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
usingnamespace std;
int main ()
{
int *p;
int ar[]= {1,2,3,4,5,6,7,8,9,10};
p=&ar[10];
for ( int i=0; i<10;i++)
cout << *p[&ar[10]-1] << endl
return 0;
}