#include <iostream>
#include <string>
using namespace std;
int main()
{
string username;
cout<<"What is your name?:";
cin>>username;
cout<<"Hello"<<username<<"!"<<endl;
return 0;
}
-------------------Configuration: hello - Win32 Debug--------------------
Compiling...
hello.cpp
e:\heidong\vc++\hello\hello.cpp(3) : error C2871: 'std' : does not exist or is not a namespace
e:\heidong\vc++\hello\hello.cpp(6) : error C2065: 'string' : undeclared identifier
e:\heidong\vc++\hello\hello.cpp(6) : error C2146: syntax error : missing ';' before identifier 'username'
e:\heidong\vc++\hello\hello.cpp(6) : error C2065: 'username' : undeclared identifier
e:\heidong\vc++\hello\hello.cpp(7) : error C2065: 'cout' : undeclared identifier
e:\heidong\vc++\hello\hello.cpp(7) : error C2297: '<<' : illegal, right operand has type 'char [20]'
e:\heidong\vc++\hello\hello.cpp(8) : error C2065: 'cin' : undeclared identifier
e:\heidong\vc++\hello\hello.cpp(8) : warning C4552: '>>' : operator has no effect; expected operator with side-effect
e:\heidong\vc++\hello\hello.cpp(9) : error C2297: '<<' : illegal, right operand has type 'char [6]'
e:\heidong\vc++\hello\hello.cpp(9) : error C2065: 'endl' : undeclared identifier
Error executing cl.exe.
hello.obj - 9 error(s), 1 warning(s)