ReturnStatement ::= ‘return’ (S Expression)? S? ‘;’
The "return" statement indicates a return from a
function. Functions of return type void cannot use an
expression in the statement. Functions of all other
return types must have an expression, and there
must be at least one such “return” statement in the body of the
function.
The expression, if it appears, must have a resulting type
reasonably close enough to the return type; automatic typecasting to the
return type occurs if there is a mismatch. It is not
possible to return a pointer for a scalar return type or a nonzero scalar value
for a pointer return type.
See also: [Evaluation and null
statements] [The "goto" statement and text labels]
[The "return" statement] [The
"if" and "else" statements]
[The "for" statement] [The
"while" statement] [The "do" statement] [The
"switch," "case," and "default" statements]
[The "break" statement] [The
"continue" statement] [Opcode and mod byte
escape sequences]
|