linux下编程的莫名其妙问题(郁闷)?!
我的代码:
/* text.c */
#include <stdio.h>
bool fun1(int i);
int main()
{
..........
return 0;
}
bool fun1(int i)
{
int j;
for (j = 2; j <= j / 2; j++)
if (i % j == 0)
return false;
return true;
}
我编译命令:
gcc test.c
它会报错:
意思大概是对bool false true 没有定义;
于是我用g++ test.c
可以通过,看来c++还是支持的;
但为什么c不支持,
我还加了stdlib.h 都不行 ??
请问是为什么??