Code:
#include <iostream>
#include <string>

using namespace std;

int main() {
	cout << "What is your name? " << flush;
	
	string nm;
	getline(cin, nm);

	cout << endl << "Hello " << nm << "!" << endl;


	return 0;
}
See www.bruceeckel.com (Thinking In C++) for more info on strings