Changing output in C

Lenovo / 42334dg
April 24, 2009 at 10:26:04
Specs: Microsoft Windows Vista Home Premium, 2 GHz DualCore/ 2041 MB
Hi, I'm writing a program to output a process. I've seen other programs change the ouput that's already in the console, is that possible in C? For example:
My program would output this:
1%
2%
3%
4%
5%
etc.
but I want it to change the last output to the new so that 1% would become 2% and then 3 and so on. And without clearing the screen from all output history.
Any help appreciated, and I've tried google, but still, I don't really know what this is called so what would I search for?

Live the life as you know it
/ Wille


See More: Changing output in C

Report •


#1
April 24, 2009 at 13:50:23
There isn't really any standard way to manipulate the console as the functions are mostly compiler specific. What compiler are you using?

If you're lucky, you might be able to use windows.h - here's a link to a broad example that covers a lot of console functions.

Look for the SetConsoleCursorPosition function.

HTH

______________________
My work in progress. I hate JS. :P


Report •

#2
April 24, 2009 at 14:59:22
Ok thanks, I'll see to that link, I'm using Bloodshed Dev-Cpp.

Live the life as you know it
/ Wille


Report •

#3
April 24, 2009 at 22:28:39
You might also want to check this page for a devc conio library. The download can be found here. I'm not familiar with dev-c, but the download appears to be some sort of packaged archive that you'd open or install with the compiler.

hope that helps.

______________________
My work in progress. I hate JS. :P


Report •

Related Solutions


Ask Question