1

An error is being given on all printf statements stating:

Data Arguement Not Used by Format Strings.

I looked around on the internet and found some related things however I did not fully comprehend the solution and was hoping maybe someone on here could explain further.

void displayPuzzle()
{
int i, j;
char x = 'A';

for (i = 0; i < COLOUMNS; i ++)
{
    printf("%c  ", x); //error here
    x++;
}
printf("\n\n");
for (i = 0; i < ROWS; i ++)
{
    printf("%d\t", i); //error here
    for (j = 0; j < COLOUMNS; j ++)
    {
        printf("%c  ", puzzle[i][j]); //error here
    }
    printf("\n\n");
}

}
David
  • 1,192
  • 5
  • 13
  • 30
  • You should read printf's man – KeylorSanchez Nov 24 '15 at 15:21
  • 1
    The data argument you passed to printf doesn't have a matching conversion specifier in the format string. If you don't understand what that means then "hmmm something-something-format string error on this line where I have printf, I better check the printf twice" should be enough to solve the problem. – Lundin Nov 24 '15 at 15:28

1 Answers1

10

Format string specifiers for printf use % to denote the start of a format specifier, not &.

void displayPuzzle()
{
    int i, j;
    char x = 'A';

    for (i = 0; i < COLOUMNS; i ++)
    {
        printf("%c  ", x);
        x++;
    }
    printf("\n\n");
    for (i = 0; i < ROWS; i ++)
    {
        printf("%d\t", i); 
        for (j = 0; j < COLOUMNS; j ++)
        {
            printf("%c  ", puzzle[i][j]); 
        }
        printf("\n\n");
    }

}
dbush
  • 205,898
  • 23
  • 218
  • 273