+ 1
How will me do function "sleep" in c++?
2 Answers
+ 3
Declaring a function in C++ follow this format.
If your function is returning a value.
return_type func_name (parameters){
//What your function does
return; //what to return
}
If it's not returning a value
void func_name (parameters){
//Some code
}
As in sleep function.
void sleep (int hours){
Cout <<"Sleep for" <<hours<<"hours"<<endl;
}
+ 1
#include<windows.h>
sleep(1000); //1000 is milisecond



