C++: Get char after space character instead or return carriage.

Posted by Kzone272 on Stack Overflow See other posts from Stack Overflow or by Kzone272
Published on 2011-02-28T23:16:28Z Indexed on 2011/02/28 23:24 UTC
Read the original article Hit count: 183

Filed under:
|
|
|
|

Okay this is similar to my last question but what I ended up doing was way too complex for something as simple as this. I simply need to get a single character or number (I will know which of these I am receiving) from the console after I press space, instead of pressing enter. I'm sure there must be a way to have the terminal read input after a space instead of a '\n'. I need to read inputs from the console in which the succeeding data types will vary depending on what the first input is, and I think reading the entire line, parsing it into strings, then parsing some of those into ints is a bit unnecessary.

So Is this actually not possible in C++ or have I just not found it yet?

© Stack Overflow or respective owner

Related posts about c++

Related posts about input