C language - Boolean type

The Boolean type _Bool was introduced in C99 to represent true and false types .

Here is its header file:

 

 example:

#include<stdio.h>
#include<stdbool.h>
int main()
{
	_Bool flag = false;
	if (flag)
	{
		printf("hehe\n");
	}
	if (!flag)
	{
		printf("haha\n");
	}
	return 0;
}

 

Guess you like

Origin blog.csdn.net/outdated_socks/article/details/129578667