cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
User Input in String Variable
User Input in String Variable
Nov 12, 2012 at 6:54pm UTC
Farrukh12
(32)
How can I store a input from a user in the form of phrase like "Hello How Are"
in a string variable.
Note: The Spaces should be included in the variable.
Nov 12, 2012 at 7:05pm UTC
Chervil
(7320)
1
2
string line; getline(cin, line);
http://www.cplusplus.com/reference/string/getline/
http://www.cplusplus.com/reference/iostream/istream/getline/
Last edited on
Nov 12, 2012 at 7:07pm UTC
Nov 12, 2012 at 7:05pm UTC
Fransje
(435)
Use the getline() function:
http://www.cplusplus.com/reference/string/getline/
Last edited on
Nov 12, 2012 at 7:05pm UTC
Nov 13, 2012 at 7:16am UTC
Farrukh12
(32)
Thank You
Topic archived. No new replies allowed.