KayodeCS_BU
asked on
Writing to standard output in C++
I want to write to the standard output, but I want to be able to write to the same area more than once.
So if I have a cout<<"message1", and I have more than 1 message, I want to be able to cout<<"message #" in the same spot in the console that message1 was outputted to the screen. I think I have to decrement the stream pointer to the stdout, but I'm not sure how to do it. Is it even possible?
Thank you,
K
So if I have a cout<<"message1", and I have more than 1 message, I want to be able to cout<<"message #" in the same spot in the console that message1 was outputted to the screen. I think I have to decrement the stream pointer to the stdout, but I'm not sure how to do it. Is it even possible?
Thank you,
K
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok, it didn't work at first, but I flushed the stdout buffer,cout<<flush;, between the two messages and I got it to work. Thank you, I've never seen the \r before.
K
K
https://www.experts-exchange.com/questions/20544311/Writing-to-StdOut-in-C-console-program.html
Exceter