In VC++ we have the data type “BOOL” which can assume the value TRUE or FALSE, and we have the data type “bool”, which can assume the value true or false.
What is the difference between them and when should each data type be used?
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.
boolis a built-in C++ type whileBOOLis a Microsoft specific type that is defined as anint. You can find it inwindef.h:The values for a
boolaretrueandfalse, whereas forBOOLyou can use anyintvalue, thoughTRUEandFALSEmacros are defined in thewindef.hheader.This means that the
sizeofoperator will yield 1 forbool(the standard states, though, that the size ofboolis implementation defined), and 4 forBOOL.Source: Codeguru article