Hi,
I am trying to change the address in an array using *nums++. When I run the program, however, the first number in the array is skipped. What am I missing? How do I get the first number to display?
#include <stdio.h>
int print(int[]);
int main()
{
#define NUMBERS 7
int nums[] = {2, 4, 5, 7, 9, 11, 13};
print(nums);
return 0;
}
int print (int *nums)
{
int i;
i = *nums++;
for (i = 1; i < NUMBERS; i++, nums++)
printf("Address %d contains number %d\n", i, *nums );
return 0;
}