Link to home
Start Free TrialLog in
Avatar of KayodeCS_BU
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
Avatar of Exceter
Exceter
Flag of United States of America image

ASKER CERTIFIED SOLUTION
Avatar of Kocil
Kocil

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KayodeCS_BU
KayodeCS_BU

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