M
mdh
A happy and safe Easter to all.
I am tackling this, and in the process, wrote this little bit of code.
#include <stdio.h>
static char mnths[] = {0,1,2,3,4,5,6,7,8,9,10,11,12};
int main () {
int i;
for (i=1; i<=12; i++)
/**printf("%d\n", mnths); **/ works
printf("%d\n", *mnths++); <<<-------error:rong type code to increment
return 0;
}
I thought that an array was passed to printf as a pointer, but I am
obviously missing something.
I am tackling this, and in the process, wrote this little bit of code.
#include <stdio.h>
static char mnths[] = {0,1,2,3,4,5,6,7,8,9,10,11,12};
int main () {
int i;
for (i=1; i<=12; i++)
/**printf("%d\n", mnths); **/ works
printf("%d\n", *mnths++); <<<-------error:rong type code to increment
return 0;
}
I thought that an array was passed to printf as a pointer, but I am
obviously missing something.