Prerequisite: Bool Data Type in C++
The C99 standard for C language supports bool variables. Unlike C++, where no header file is needed to use bool, a header file “stdbool.h” must be included to use bool in C. If we save the below program as .c, it will not compile, but if we save it as .cpp, it will work fine.
If we include the header file “stdbool.h” in the above program, it will work fine as a C program.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
- Difference between High Level and Low level languages
- AKTU (UPTU) Previous Year Solved Papers | C Programming
- OpenMP | Hello World program
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- getdate() and setdate() function in C with Examples
- OpenMP | Introduction with Installation Guide
- X-Macros in C
- What does main() return in C and C++?
- SDL library in C/C++ with examples
- Why to use fgets() over scanf() in C?
- Thread functions in C/C++
- How to Compile and Run C/C++/Java Programs in Linux
- How to get the current position of cursor from output screen in C?
- Methods to concatenate string in C/C++ with Examples