基础
- c语言没有定义哈布尔类型,约定0为假,非0为真
#include <stdio.h>
int main(void)
{
if (1) {
printf("hello world");
}
getchar();
return 0;
}
使用define(不建议)
#define BOOL int
#define TRUE 1
#define FALSE 0
#include <stdio.h>
int main(void)
{
BOOL flag = TRUE;
if (flag) {
printf("hello world");
}
getchar();
return 0;
}