Contents
Up
Previous
Next


Return statement


The return statement causes the completion of the execution of a subprogram, and if the subprogram is a function, then it specifies the value the function should return. The syntax is:
return-statement : RETURN [ expression ] ";"

The return statement may only appear in a subprogram body. The expression part may only appear in a function body and must be the same type as the return type of the function.