Learn To Program
Increase Your Knowlegde and Build Your Skill!
Pages
(Move to ...)
Home
Me
▼
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;
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment