Void functions do not require a return as the void signifies that the
function will return nothing.  Just fyi to anyone that might need to know,
every function starts with the data type that it will return.

So, "float compute_average()" will return a floating point number.  As a
matter of fact, the code will not compile if there is no return statement.
This follows all cases except the void function.  I am not aware of any
adverse affects of having no return statement since it is not expected.  The
function will move through to the closing bracket and if no data type is
expected, then normal routine will move on.

Jeremy

http://mud.mdhoria.org



Reply via email to