#confused about order I should use cin.get or cin.peek to get something from the cin stream
8 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
You need cin.get(), because cin.peek() returns the next character that can be extracted, it doesnt move the marker
How can i detect certain characters like \n and \t or whitespace
You can do a comparison, or better yet you can use std::isspace(char) which returns bool, signaling if the character passed is a newline, tab or other sort of whitespace.
Tysm
@twilit sundial Has your question been resolved? If so, type !solved :)
!solved