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
Strings
Strings
Mar 24, 2013 at 11:56am UTC
bboyfresh
(1)
Is there any way of inputting strings till a certain character?
cin inputs till space, getline till an enter, but is there a way i can define when it has to stop inputting, like, input a string until a '.' is written?
Mar 24, 2013 at 12:10pm UTC
vlad from moscow
(6539)
You can use std::getline. For example
std::string s;
std::getline( std::cin, s, '.' );
Topic archived. No new replies allowed.