write to same line on sceen

Apr 23, 2008 at 1:11am
So I wrote this cheesy program back in college and now I can't remember how to do it at all X-(

When you do cout it prints in order, so:
1
2
cout<<"everybody";
cout<<"hello";

displays "everyonehello", right?

How do I reset the cursor to the beginning, so to speak, so that instead it displays "hellobody" on that same line? (The first 5 characters on the screen get overwriten.) Thanks!

Last edited on Apr 23, 2008 at 1:11am
Apr 23, 2008 at 11:26am
 
std::cout << '\xd'


will output a carriage return (but not a line feed).
Apr 25, 2008 at 7:26am
That works great、thanks!
Topic archived. No new replies allowed.