Format specifier in scanf for bool datatype in C

There is none.

Use a temp object as the size of _Bool is implementation dependent.

#include <stdbool.h>
#include <stdio.h>

bool b;
int temp;

scanf("%d", &temp);
b = temp;

Leave a Comment