Can anyone explain me what is the difference between the _Bool and bool data type in C?
For example:
_Bool x = 1;
bool y = true;
printf("%d", x);
printf("%d", y);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
These data types were added in C99. Since
boolwasn’t reserved prior to C99, they use the_Boolkeyword (which was reserved).boolis an alias for_Boolif you includestdbool.h. Basically, including thestdbool.hheader is an indication that your code is OK with the identifierboolbeing ‘reserved’, i.e. that your code won’t use it for its own purposes (similarly for the identifierstrueandfalse).