Console Screen update - Iteration Count

Discussion in 'C Programming' started by karthigan@yahoo.com, Sep 1, 2005.

  1. Guest

    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.
    , Sep 1, 2005
    #1
    1. Advertising

  2. kyle york Guest

    Greetings,

    wrote:
    > 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);

    >
    > Is there a better way to update the Iteration count without having to
    > clear the screen?
    >
    > Regards,
    > Karthigan.
    >



    --
    Kyle A. York
    Sr. Subordinate Grunt
    kyle york, Sep 1, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M.Kamermans

    XSLT - maintaining iteration count

    M.Kamermans, Jan 29, 2005, in forum: XML
    Replies:
    6
    Views:
    8,240
    Dimitre Novatchev
    Jan 30, 2005
  2. Ben Finney
    Replies:
    2
    Views:
    978
    Egor Bolonev
    Jun 30, 2003
  3. Replies:
    2
    Views:
    368
  4. Rudi
    Replies:
    5
    Views:
    4,969
  5. efelnavarro09
    Replies:
    2
    Views:
    916
    efelnavarro09
    Jan 26, 2011
Loading...

Share This Page