This c code
int rhdDEboard2(){
int board[64]={0};
int rc;
printf("\n");
for (rc=0;rc<8;rc++)
printf("\t %i %i %i %i %i %i %i %i\n",board[rc]);
printf("\n");
return 0;
}
compiled with MinGW in Win8 PC gives this error: : warning: format '%i' expects a matching 'int' argument [-Wformat]
I do not understand why! The board array is declared as type int..isn't it? (Does C treat the array as a pointer type?). I have tried using %p as format specifier but that doesn't work and nor does using %d. I understand what the warning says, but not why it says it, nor how to fix it, and feel I must be missing something quite basic, simple and straightforward here, but I do not understand this compiler warning.I'm grateful for help to try and get me to understand this C compiler warning and how I should fix it..many thanks
%i
in the formatting string, but you only have 1board[rc]
in the rest of the arguments. It's complaining about the other 7 that don't have a corresponding argument. – Barmarboard[rc * 8]. board[rc * 8 + 1], .., board[rc * 8 + 7]).
– ryanpattison