avoid new line after cin.

I would like to print some thing out. Then the user should be sble to input a number. Now i want to avoid the programm to jump to a new line. Possible?

and is it possible that the whole sentence appears and you have to input a number BETWEEN 2 words of the sentence?
I really need an answer guys! Is there something you didnt understand about the question? My main question is:

Can you print something out, that will be printed out beside the number that I input? That means, that the text wont appear on the next line?
As I understand it, input through cin is buffered. In order for the user's input to be sent to your program, they must press enter, moving the cursor to a new line.

I believe the curses console library can, among other things, solve your problem but it might be more than what you're looking for.
A workaround, I guess, could be to clear the screen and reprint the whole line with the added input on.

Not the best solution, but a pretty easy one.
Last edited on
Here's an idea, don't bother. Concentrate in your program instead of the interface.

Checkout curses if you want.
Topic archived. No new replies allowed.