Computing.Net > Forums > Programming > c programming carrier return

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.

c programming carrier return

Reply to Message Icon

Name: skips1983
Date: July 24, 2006 at 13:17:12 Pacific
OS: Fedora Core 2
CPU/Ram: 1ghz
Product: c-pac
Comment:

Im have a precentage indicator that (obviously) counts to 100%. At the moment it does so by adding a new line

1%
2%
3% ....etc

I want it to display on the same line so I tried the carrier return function "/r". Although it prints on the same line, it seems very slow to update itself, displaying a percent every 20+ or so. Is there a better way of doing this.

Cheers

PS this is the line of code to print

printf("Status: %.1f%% \r",j/244.0*100);



Sponsored Link
Ads by Google

Response Number 1
Name: Fozzie
Date: July 25, 2006 at 12:19:20 Pacific
Reply:

With Borland Turbo C++ 3.2? you can use 'gotoxy' to reposition the cursor every time you print.


0

Response Number 2
Name: Fel
Date: July 25, 2006 at 12:22:06 Pacific
Reply:

what do you mean?
at first it's like this?
1%
2%
3%
.
.
.
100%

and then you want to make it like this?
1% 2% 3% . . . 100%

if it's true, then just use the printf command


Athlon 64 2800+ @ 2.63 Ghz Stock Cooling
Timings:2-3-2-5
V-Gen 512MB pc3200
DFI Lanparty UT NF3
Abit R9550 VGuru XTurbo
525Mhz/300Mhz


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: c programming carrier return

Need help with C programming www.computing.net/answers/programming/need-help-with-c-programming/6970.html

C programming help www.computing.net/answers/programming/c-programming-help-/6364.html

running C programs www.computing.net/answers/programming/running-c-programs/3587.html