当前位置: 技术问答>linux和unix
这个程序在linux的g++编译时错在哪里
来源: 互联网 发布时间:2015-09-09
本文导语: t2.cpp: #include #include main() { string e="hh"; } 使用以下命令编译: g++ -g t2.cpp -o t2 出现以下语句string is declared(first use this funtion. 我是包含的文件错误还是怎么回事请大家指教以下.(一定用c++写) | ...
t2.cpp:
#include
#include
main()
{
string e="hh";
}
使用以下命令编译:
g++ -g t2.cpp -o t2
出现以下语句string is declared(first use this funtion.
我是包含的文件错误还是怎么回事请大家指教以下.(一定用c++写)
#include
#include
main()
{
string e="hh";
}
使用以下命令编译:
g++ -g t2.cpp -o t2
出现以下语句string is declared(first use this funtion.
我是包含的文件错误还是怎么回事请大家指教以下.(一定用c++写)
|
这个是c++标准化后使用命名空间的使用方法.
其实,你也可以如此修改(c++标准化之前的使用方法)
#include
#include
改为
#include
#include
但是,现在一般推荐使用标准化后的.
#include
#include
using namespace std;
其实,你也可以如此修改(c++标准化之前的使用方法)
#include
#include
改为
#include
#include
但是,现在一般推荐使用标准化后的.
#include
#include
using namespace std;
|
在main前写上 using namespace std;