+ 6
How to use waiting in c++ ????
I want to stop my code for 20 seconds.... by doing like processing or wating.... I tried header file <time.h> but problem is It didn't work or I don't know how to use... help.... thank you in advance...
3 Antworten
+ 5
Instead of using time you can use dos.h header file.
Here is an example of code :
#include <iostream.h>
#include <dos.h>
void main ()
{
delay (20000);
cout<<"This line will displayed after 20 seconds";
getch ();
}
Here delay function uses dos header file.
value 1000 in delay means 1 seconds
Therefore to delay it 20 seconds we have entered 20000.
+ 4
thankx I will try this...
+ 2
It works in IDE, but not in sololearn's code playground.