In the following example, I'm trying to scan the value of a Boolean type of variable. When I compile in GCC, I get the following warning,
warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘_Bool *’ [-Wformat=]
scanf("%d", &b);
Code:
#include <stdio.h>
#include <stdbool.h>
int main()
{
bool b;
scanf("%d", &b);
printf("%d\n", b);
}
Is there a format specifier of bool in C?