c++ - Update and multiple console windows -


i want write simple c++/c console app, show process 1% 2%. now, print line line like

finished 1% finished 2% 

and etc

how can update percentage x% without printing new line?

also, want open 2 console windows 1 show messages 1 show process above. how open console window?

on most-all terminals, can print ascii carriage return '\r' (value 13 decimal) return cursor left of current line, allowing overwrite previous value. or, can send backspaces ('\b', ascii 8) move single character left. neither automatically remove content displayed, can overwrite no longer want see spaces. alternatively, can use control codes supported particular console (e.g. vt100, vt220...), have more advanced features such "clear-to-end-of-line". many libraries available detect terminal type , use codes supports, or synthesize advanced operations many simpler ones necessary: on linux , unix, ncurses library choice.

c++ has no concept of console windows. opening second window depends lot on operating system you're using, , perhaps graphics library, neither of specified. on os though, can have application write messages file, inspect file window open yourself. on linux/unix, utility "less" great inspecting log files - showing contents @ time ran less, can ask "follow" new data written file.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -