First page Back Continue Last page Graphics
Function Declaration, contd.
- the return command, returns a value when the function is called
- if there is nothing to return (void), then no return command is needed
- the return variable type must match the type in the declaration
- if you call return, then the function exits; any code after a return in a function will be ignored
- variables declared inside of a function cannot be seen outside of this function
- this means you can reuse variable names within other functions