Nothing. It's void of return.
Originally Posted by HawkLord
int funct() - returns an int
char function() - returns a char
void function() - returns nothing
int funct( void ) - returns an int
char function( void ) - returns a char
void function( void ) - returns nothing
The (void)'s just mean that the functions don't take any parameters. It's strictly not necessary to have them there, but I'm somewhat pedantic about layouts etc.
Do you understand why it returned 35 though?
Here's another example -
Add( int New_x, int New_y ) : x( New_x ), y( New_y )
// This is called an itilisation list. Just another way of intialising class members
int Add_XY ( void )
return ( x+y );
int main( void )
int result, User_x, User_y;
std::cout<< "Enter int one: ";
std::cin >> User_x;
std::cout<< "Enter int two: ";
std::cin >> User_y;
Add MyInstance( User_x, User_y );
result = MyInstance.Add_XY();
std::cout<< "The result of Add::Add_XY() is: " << result;