Jump to content

using character to end cin statement

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
PeaceFrogs

PeaceFrogs

    Newbie

  • Members
  • Pip
  • 4 posts
hey this might not even be possible i know that cin will stop reading in data once the user hits space or enter but is it possible to change that from a space to a character of some sort

if you could please provide and example or link me to where there is one

thanks in advance :D

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
You can use cin.unsetf(ios_base::skipws) to have cin keep reading strings when whitespace is encountered. cin.get() can also be used to input characters into an array of characters. cin.getline() is another option. cin.getchar() is a third if you want to process the input manually.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog