Syntax

BNF

return-statement
::= 'return' <expression> ';'
::= 'return' ';'

EBNF

return-statement
::= 'return' ';'
::= 'return' <expression> ';'

Contextual Constraints

return-statement
The return statement can only be used within the body of a function definition statement.
A return statement in a void function cannot include an expression.
expression
The type of the expression should be the same as the type of the enclosing function.

Semantics

return-statement
The return statement returns control to the expression which called the function, along with the value of the expression following the return keyword.
expression
The expression is evaluated, and its value is returned to the calling expression.

Flowchart

Flowchart of the return statement

Remarks

External Links

MSDN The C return Statement Visual Studio 6.0

Other Languages

C Now
C return Statement
C++ Now C++ return Statement
PHP Now PHP return Statement