Console Screen update - Iteration Count

K

karthigan

I am writing a simple hardware test program in C that would run from
Windows command line.

Inside one of the loops, I have this code fragment that would display
the Iteration count.

{
....
system("cls");
printf("\nIteration:%d", i);
....
}

Since I have to clear the screen everytime I update the Iteration
count, there is lot of "FLICKERING".

Is there a better way to update the Iteration count without having to
clear the screen?

Regards,
Karthigan.
 
K

kyle york

Greetings,

I am writing a simple hardware test program in C that would run from
Windows command line.

Inside one of the loops, I have this code fragment that would display
the Iteration count.

{
...
system("cls");
printf("\nIteration:%d", i);
...
}

Since I have to clear the screen everytime I update the Iteration
count, there is lot of "FLICKERING".

printf("Iteration:%d\r", i);
fflush(stdout);
 

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
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top