+ 1
What is role of void keyword in declaring functions ???
example if possible !!! [in detail] !!!
2 ответов
+ 3
void functions doesnt return a value
void func() {
int x = 5;
int y = 3;
int sum = x + y;
std::cout << sum;
}
with an int function you can return the value
int func() {
int x = 5;
int y = 3;
int sum = x + y;
return sum;
}