Computing.Net > Forums > Programming > Changing output in C

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Changing output in C

Reply to Message Icon

Name: wille
Date: April 24, 2009 at 10:26:04 Pacific
OS: Microsoft Windows Vista Home Premium
CPU/Ram: 2 GHz DualCore/ 2041 MB
Product: Lenovo / 42334dg
Subcategory: C/C++
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: shutat
Date: April 24, 2009 at 13:50:23 Pacific
Reply:

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


0

Response Number 2
Name: wille
Date: April 24, 2009 at 14:59:22 Pacific
Reply:

Ok thanks, I'll see to that link, I'm using Bloodshed Dev-Cpp.

Live the life as you know it
/ Wille


0

Response Number 3
Name: shutat
Date: April 24, 2009 at 22:28:39 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Changing output in C

Capturing DOS output in C++ www.computing.net/answers/programming/capturing-dos-output-in-c/416.html

+ infinity in C www.computing.net/answers/programming/-infinity-in-c/4139.html

batch file to change prices in ini www.computing.net/answers/programming/batch-file-to-change-prices-in-ini/17482.html