GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Saturday, March 12, 2011

CPP - String Type

To get a line from promt, use
string message;
getline(cin, message);
cout << message << endl;

This also works for reading a line text from text file:
ifstream infile("lola.txt");
string message;
getline(infile, message);
cout << message << endl;
Share/Bookmark

No comments:

Post a Comment