GMgKe586q6suSQnyqZLlGCooeWM
Learn To Program
Increase Your Knowlegde and Build Your Skill!
Pages
Home
Me
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;
CPP - String Type
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment