The main program takes an array, and prints out the values in reverse order. So if I have an array of ten elements it prints out the last one first and so on. The main program calls the function in a weird way and I'm not sure how to make it work right. Here's the function call:
printf("%2d ",*revElement(a));
my code for the function is:
int revElement(int theArray[]){
static int place = N;
--place;
return theArray[place];
}
my code works with the print statment only if I remove the pointer.

New Topic/Question
Reply




MultiQuote






|