cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : UNIX/Linux Programming : write to same line on sceen
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Articles
Lounge
Jobs

-

post  write to same line on sceen

mrbubblesort
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
jsmith
std::cout << '\xd'

will output a carriage return (but not a line feed).
|
mrbubblesort
That works great、thanks!
|

Registered users can reply in this forum.
Home page | Privacy policy
© cplusplus.com, 2000-2008 - All rights reserved - v2.2
Spotted an error? contact us