For example could I make it type something like
"Hello"
"This"
"Is"
"A"
"Test"
With 1 second intervals in-between each new line?
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well the
sleep()function does it, there are several ways to use it;On linux:
And on windows you can use either dos.h or windows.h like this:
or you can use dos.h for linux style sleep like so:
And that is how you sleep in C on both windows and linux! For windows both methods should work. Just change the argument for # of seconds to what you need, and insert wherever you need a pause, like after the printf as I did. Also, Note: when using windows.h, please remember the capital
Sin sleep, and also thats its milliseconds! (Thanks to Chris for pointing that out)