I want to remove warning without change data-type to char.
#include<stdio.h>
#include<stdlib.h>
main()
{
unsigned char ch;
printf("Hello This is Problematic\n");
scanf("%d",&ch);
printf("1\n");
}
This generates the warning
test.c:7:2: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘unsigned char *’ [-Wformat=] scanf("%d",&ch);
%d
-->"%hhu"
or%c
,main()
-->int main(void)
– BLUEPIXY