Help with console program
How can I create a console program that simultaneously handles input from the user, and outputs text? I tried creating a sample program with two threads, one basically did something like
Code:
while (true) { getline(cin, somestring ); }
and the other thread randomly slept and wrote to the console. The problem was that when I begain to write input, the output function (which just cout-ed a string) cut off the text I had written so far. I would like behavior that simply "pushes" what I'm writing to the bottom line, and every time I cout something, it will appear above that, so the last line in the console will be reserved for user input, never touched by the output text.
This can be windows specific, as I am not working with any other operating system.
Thanks in advance.