How can I pause my program for like 3 seconds then clear the screen then put some text up? Any help would be great, thanks i advanced....
How can I pause my program for like 3 seconds then clear the screen then put some text up? Any help would be great, thanks i advanced....
Sleep is in milliseconds and system gets passed a char * which represents what you would type at the console.Code:#include<iostream> #include<windows.h> using namespace std; int main(void){ cout<<"Here is my text"; Sleep(3000); system("cls"); return(0); }
You mean:
Code:#include <iostream> #include <windows.h> #include <ctime> using namespace std; int main(void){ float time_delay = 3; cout<<"This is my text"; clock_t delay = time_delay*CLOCKS_PER_SEC; clock_t start = clock(); while (clock() - start < delay); system("cls"); return 0; }