Console output to a fixed area

M

MuZZy

Hi,

Not sure if it's not a OT, as maybe it's OS dependable, so my apology in advance :)

I need to be able to output to a fixed area on console when i show the work progress in %
If i use smth like printf, it will add lines, but i need to show changing percentage in the same place of console.

Is there a library for that or is it platform-dependable?
I'm using VC++ 6 on Windows


Thank you in advance,
Andrey
 
V

Victor Bazarov

MuZZy said:
Not sure if it's not a OT, as maybe it's OS dependable, so my apology in
advance :)

Alas, it is. It is certainly. Accepted.
I need to be able to output to a fixed area on console when i show the
work progress in %
If i use smth like printf, it will add lines, but i need to show
changing percentage in the same place of console.

Often printing \r would work to move the cursor to the beginning of
the same line, but it won't work on some terminals or on all systems.
Is there a library for that or is it platform-dependable?

There is, and it is.
I'm using VC++ 6 on Windows

comp.os.ms-windows.programmer.win32, microsoft.public.vc.language, etc.

V
 
M

MuZZy

Victor said:
Alas, it is. It is certainly. Accepted.



Often printing \r would work to move the cursor to the beginning of
the same line, but it won't work on some terminals or on all systems.

Ok, thank you, "\r" works perfect for me!
 
M

Mike Wahler

MuZZy said:
Ok, thank you, "\r" works perfect for me!

But as Victor said, be warned that you cannot depend upon this
behavior for all systems or for the same system with a
different output device.

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,197
Messages
2,571,040
Members
47,634
Latest member
RonnyBoelk

Latest Threads

Top