在Linux平台上声明c中的bool变量

Khu*_*boo 14 c variables boolean declaration

如何在Linux平台上运行的C中声明bool数据类型的变量.我尝试了以下但它给出了一个错误:

#include<stdio.h>
#include<string.h>

bool factors[1000]
void main()
{
}
Run Code Online (Sandbox Code Playgroud)

Pot*_*ter 38

你只需要#include <stdbool.h>.


Mic*_*fik 5

C没有bool类型.您可以int改为使用0表示false和1表示true.