#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)

twilit sundial
#

Hi I am trying to read from the cin stream and gather all words, chars, and ints, in order to store them in a unordered_map, but I am having trouble with the operation of knowing what is stored from cin.get and gathering the data in general

fluid kettleBOT
#

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.

pale vault
#

You need cin.get(), because cin.peek() returns the next character that can be extracted, it doesnt move the marker

twilit sundial
pale vault
fluid kettleBOT
#

@twilit sundial Has your question been resolved? If so, type !solved :)

twilit sundial
#

!solved