Originally Posted by
Moonbat
A function that takes no parameters (a void function) cannot return an assignable value. So therefore, even if the overall function does return an int, you can't assign it to any other variable.
Though I haven't done any C++ programming in a while, I know that functions that take no parameters can return values if they're not preceded by void. Functions' return values are dictated by the type stated before them,
Code:
int SomeFunction()
{
/* Do something */
return *;
}
int aaa = 0;
aaa = SomeFunction();
In this case, SomeFunction returns an integer. It has no parameters.
A function declared to return void, however, can't return anything -- it has no return statement:
Code:
void SomeFunction()
{
/* Do something */
}
SomeFunction();
A function that takes no parameters (a void function) cannot return an assignable value.
A void function in my definition is a function declared as type void (void SomeFunction()). One that doesn't take any parameters is just a function without parameters.