#include <iostream.h>
#include <string.h>
using namespace std;int main()
{
string strName; cout<<"Please input your name:";
cin>>strName;
cout<<"\nHello"
<<strName
<<"....GoodBye!"; return 0;
}
这是essential c++中的第一个例子程序。
我在vc6++下编译有四个错误:
D:\C++\Test1_1\Test1_1.cpp(4) : error C2871: 'std' : does not exist or is not a namespace
D:\C++\Test1_1\Test1_1.cpp(8) : error C2065: 'string' : undeclared identifier
D:\C++\Test1_1\Test1_1.cpp(8) : error C2146: syntax error : missing ';' before identifier 'strName'
D:\C++\Test1_1\Test1_1.cpp(8) : error C2065: 'strName' : undeclared identifier那位能告诉我应该怎么解决吗?