Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Does bool occupy 1 byte in C language? What if only one person is occupied?
Does bool occupy 1 byte in C language? What if only one person is occupied?

The materials to be prepared are: computer and C language compiler.

1. First, open the C language compiler and create a new initial. cpp file, for example, test.cpp.

2. in the test.cpp file, enter the c language code: bool a; printf("%d", sizeof(a)); .

3. The compiler runs the test.cpp file, and the number of bytes of bool type successfully printed at this time is 1.