+ 1

How will me do function "sleep" in c++?

24th May 2020, 7:33 AM
Данил Пчелинцев
Данил Пчелинцев - avatar
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; }
24th May 2020, 8:14 AM
Timothy Adeleke
Timothy Adeleke - avatar
+ 1
#include<windows.h> sleep(1000); //1000 is milisecond
24th May 2020, 6:02 PM
Win Htay 🇲🇲
Win Htay 🇲🇲 - avatar