I wanted to make a little experiment with scanf(). I wanted to read a small (<=255) integer from the user and store it in a char type.
I did:
char ch;
scanf("%d",&ch);
It works, but I want to satisfy the compiler and not to get this warning:
warning: format specifies type 'int *'
but the argument has type 'char *' [-Wformat]
scanf("%d",&ch);
Any idea?