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 都不行 ??
请问是为什么??
/* 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 都不行 ??
请问是为什么??
...全文
相关推荐
精品资料(2021-2022年收藏)福建省中小学教师晋升中级职称模拟题小学数学.doc
教育资料
2015福建省中小学教师晋升中级职称考试模拟题(含答案).doc
2015福建省中小学教师晋升中级职称考试模拟题(含答案).doc
小学数学福建省中小学教师晋升中级职称模拟题A卷.doc
小学数学福建省中小学教师晋升中级职称模拟题A卷.doc
专题资料(2021-2022年收藏)福建省中小学教师中级职称晋升考试小学语文.doc
最新完美版教育资料
精品资料(2021-2022年收藏的)福建省农村小的学音乐教师教育教学能力提升工程省级培训.doc
精品资料(2021-2022年收藏的)福建省农村小的学音乐教师教育教学能力提升工程省级培训.doc


