最简单的helloworld编译出错,请问这是什么原因?
include<iostream>
using namespace std;
int main()
{
cout << "helloworld";
return 0;
}
编译提示:
test.cpp:1: error: expected constructor, destructor, or type conversion before '<' token
test.cpp: In function int main()
test.cpp:6: error: 'cout' was not declared in this scope
g++编译问题,求助
-
- 帖子: 7
- 注册时间: 2010-11-01 17:55
- 灰色小狼
- 帖子: 4585
- 注册时间: 2008-12-06 10:38
- 系统: Arch
Re: g++编译问题,求助
#include <iostream>
- ouch_ouch
- 帖子: 217
- 注册时间: 2010-12-24 19:52
- 灰色小狼
- 帖子: 4585
- 注册时间: 2008-12-06 10:38
- 系统: Arch
Re: g++编译问题,求助
下手就要快、稳、恨、准ouch_ouch 写了:好不容易有我能够回答的问题。。。灰色小狼 写了:#include <iostream>

-
- 帖子: 7
- 注册时间: 2010-11-01 17:55
Re: g++编译问题,求助
想不到是这样
- 灰色小狼
- 帖子: 4585
- 注册时间: 2008-12-06 10:38
- 系统: Arch
Re: g++编译问题,求助
这事没啥想到想不到的,一旦知道以后就不会错了 

- 123662981
- 帖子: 55
- 注册时间: 2010-10-22 22:11
Re: g++编译问题,求助
呵呵,是呀是呀,在论坛逛这么久都是些高端的问题,我也是菜鸟ouch_ouch 写了:好不容易有我能够回答的问题。。。灰色小狼 写了:#include <iostream>
有一天我将为你描写彩虹~
-
- 帖子: 3173
- 注册时间: 2010-01-13 23:26
Re: g++编译问题,求助
我是来测试语法高亮的。
[cpp]#include <iostream>
using namespace std;
int main()
{
cout << "helloworld";
return 0;
}[/cpp]
[cpp]#include <iostream>
using namespace std;
int main()
{
cout << "helloworld";
return 0;
}[/cpp]
Here I am.
Ubuntu 桌面培训 - 全中文官方文档,含汉化截图,提供PDF
Ubuntu 桌面培训 - 全中文官方文档,含汉化截图,提供PDF
- lifulinghan
- 帖子: 135
- 注册时间: 2009-01-05 20:14
- 联系:
Re: g++编译问题,求助
代码: 全选
#include <iostream>
using namespace std;
int main()
{
cout << "helloworld";
return 0;
}
据说一老外年轻的时候,立志要当一名伟大的作家。怎么才算伟大呢?他说:我写的东西全世界都要看到!看完他们必定会歇斯底里!会火冒三丈!会痛苦万分!结果,他成功了,他在微软公司负责写系统蓝屏时的报错提示信息.....