Is boolean return type allowed in C?
#include<stdio.h>
#include<stdbool.h>
void main(){
bool x = true;
if(x)
printf("Boolean works in 'C'. \n");
else
printf("Boolean doesn't work in 'C'. \n");
}
bool
does not exist as a keyword pre-C99.
In C99, it should work, but as @pmg points out below, it's still not a keyword. It's a macro declared in <stdbool.h>
.
try to include:
#include <stdbool.h>