[prog] making statements wait x number of seconds

aec brat at magma.ca
Wed Sep 1 21:30:25 EST 2004


Hi,

So far in my C book, I have worked my through whiles, ifs, do's
and of course functions and variables, its going pretty 
good, and I have managed to solve most of my problems
without having to dump them on you :)

Several times however, I have needed to make the program 
wait x number of seconds before proceeding.

This has not been covered as of yet in my book so I thought
one of you might give me a pointer..

lets say I have a program, that does several things, one
of which counts to ten,

    int n;

    for (n = 0; n <= 10; ++n) { 
            
            printf("\nn = %i\n", n);
      }     

How can I make it wait 1 second, before printing each number?

I am sure a function for this is already available but I havent
yet learned how to even find existing functions.


thanks all!

-- 
Angelina Carlton


More information about the Programming mailing list