Umm.. Seriously?
Why would you declare the namespace WITHIN main?
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
{
//using namespace std;
static string name;
cout << "What is your name? ";
getline(cin,name);
cout << "Hello, " << name;
}
cout << "Are you really, " << name;
return 0;
}
Personally, I would do:
Code:
#include <iostream>
using namespace std;
int main()
{
string name;
cout << "What is your name?
cin >> name;
cout << "Hello, " << name << "!" << endl;
return 0;
}