LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1296|回复: 3

linux下c++头文件和windows不一样吗?

[复制链接]
发表于 2003-5-10 18:47:19 | 显示全部楼层 |阅读模式
#include <iostream>
int main()
{
cout<<"hello\n";
return 0;
}
编译为什么不通过?我是第一次在linux下写程序
发表于 2003-5-10 19:26:55 | 显示全部楼层
using namespace std;

g++
发表于 2003-5-11 12:05:21 | 显示全部楼层
根据《Thinking in C++》
#include<headfile.h>已经过时
现在普遍采用
#include<headfile>
using namespace std;

你如果要想详细了解,恐怕还是要看看书的。
发表于 2005-11-19 17:53:48 | 显示全部楼层
一定要再看看书!
using std::cout也行的
总是using namespace std;等于没有namespace
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表