标题:linux系统下用gcc编译c++出错。初学者,请大家帮忙。
取消只看楼主
zengxiangze
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-3-30
结帖率:100%
已结贴  问题点数:10 回复次数:0 
linux系统下用gcc编译c++出错。初学者,请大家帮忙。
源代码是:
#include <iostream>
int main()
{float x;
int i;
x=3.6;
i=(int)x;
cout <<"x="<<x<<",i="<<i<< endl;
return 0;}

编译命令是:beibei@ubuntu:~/桌面$ gcc -Wall zeng.C -o zeng
可是出现下列错误:zeng.C:7: error: ‘cout’ was not declared in this scope
                               zeng.C:7: error: ‘endl’ was not declared in this scope

这是怎么个情况????
搜索更多相关主题的帖子: linux 源代码 
2011-03-30 18:02



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-335218-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.369284 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved