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
how to read 'enter key being pressed'
how to read 'enter key being pressed'
Nov 2, 2017 at 4:33pm UTC
closed account (
1vf9z8AR
)
I want my
std::getline(std::cin,line,
'.'
)
to work in such a way that instead of a dot a simple enter key being pressed ends the user input and reads the input.
Nov 2, 2017 at 5:44pm UTC
gunnerfunner
(2127)
... simple enter key being pressed ends the user input
use the non-delim version of std::getline() which is the second one here:
http://en.cppreference.com/w/cpp/string/basic_string/getline
Topic archived. No new replies allowed.