+ 1
Void
what us void ?
9 ответов
+ 5
Void as a return value means that the function doesn't return anything. For example:
void printn(int n) {
cout << n << endl;
}
When void is in the parameter field, it means that the function doesn't take any parameter. For example:
int getAnswer(void) {
return 42;
}
+ 2
no return value
+ 2
void print()
{
cout<<"Hello world";
}
This function just prints the text on the screen, it returns nothing. That's when you use void, when you don't need to return anything.
+ 2
What does the statement "return nothing means " .
+ 1
it means that the function it is attached to will not return anything. (such as an int or double)
0
void defines a function initialization within class
0
Freer útfc btytvt5t tvffft6tyvy
- 1
no return value
- 2
it is used to initialise the body of of program.