+ 1
When do we use void?
In the tutorial apparently we used int instead of void to make a function with multiple parameters.
5 Answers
+ 7
void is used when nothing has to be returned.
Eg.
void hello (int i)
{
cout <<i;
}
int main
{
hello(1);
}
+ 7
when we do not want to return anything đ
+ 2
Void used when you do not want to return any values from function. You always must declare type of value you want return and void is like "nothing returns".
+ 1
Usually when you want to print something without returning anything
0
When we don't have to return anything.