I'm searching for a function that will print a string before the input is made. I know this is possible with printf and gets, but I want the string to stay on the last line where the input is given. The output is handled in the main thread, the input is handled in another thread started by the main thread.
For example this is the current console window (I have input the stop-command, the '>' is the prefix string):
[12:00:00] Starting server...
>stop
When the console outputs a new line, I want the input to be always on the bottom line, like this:
[12:00:00] Starting server...
[12:00:01] Server started
>stop
I am using Embarcadero C++Builder XE2 with Win32 and VCL support.
EDIT: I'm currently using this code, resulting in printing the output after the '>' prefix:
char buf[256];
printf(">");
gets(buf);
getsever for any reason. Usefgetsinstead.