#include<stdio.h>
#define SIZE 5
int *rev(int *);
int main(void)
{
int nums[5]={56, 0, 647, 3269, 2};
int g, *p2, *p3;
p2=nums;
p3=rev(nums);
for(g=0; g<SIZE; g++)
{
printf("%d\t%d\n", *p2++, *p3++);
}
return 0;
}
/***************************** rev **********************/
int *rev(int *pRev)
{
int i, numPrint;
for(i=SIZE-1, numPrint=0; i>=0; i--)
{
printf("%d ", pRev[i]);
}
printf("\n\n");
return(pRev);
}
/*
2 3269 647 0 56
56 56
0 0
647 647
3269 3269
2 2
Press any key to continue
*/
What's wrong in my program?
Howcome it won't print out my reverse order?
my answer should :
56 2
0 3269
647 647
3269 0
2 56