This preview shows page 1. Sign up to view the full content.
Unformatted text preview: The function body A function call yields a value. Therefore, execution of a function body must terminate by executing a return-statement of the form return <expression> ; where the type of the <expression> is the same as (or narrower than) the type of the result of the function. Execution of such a return-statement terminates the function body, and, thus, the function call, and yields the value of the<expression> as the result of the call. Since execution of a function body must terminate with execution of a return-statement, the last statement of a function body is usually a return-statement. However, return-statements may appear in other places as well. ©2005 Cornell University...
View Full Document
This note was uploaded on 07/07/2008 for the course CS 101 taught by Professor Gries during the Spring '08 term at Cornell University (Engineering School).
- Spring '08