I am reading a book on C.
It says that C99 added a data type _Bool.
It is basically an int but stores only 0 or 1.
Now I do not understand why there is a need of such a data type.
We already have bool which implicitly translates to int and vice versa.
So can somebody please tell me a situation where such a data type would be useful.
PS: C++ does not seem to support such a data type as seen here.
#include <iostream>
using namespace std;
int main() {
// your code goes here
_Bool b = false;
if(b == 0)
printf("FALSE");
else
printf("TRUE");
return 0;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…