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
cin
cin
Apr 5, 2019 at 8:44pm UTC
closed account (
N8MNAqkS
)
std::cin >> allows me to get user input for numbers, and then you press enter.
is there an equivalent to this for text
Apr 5, 2019 at 8:49pm UTC
deleted account xyzzy
(5768)
If you want to include spaces in your block of text, you can use std::string's std::getline().
http://www.cplusplus.com/reference/string/string/getline/
Mixing std::cin and std::getline() in retrieving input can cause problems if you don't reset the input stream.
Topic archived. No new replies allowed.