This preview shows page 1. Sign up to view the full content.
Unformatted text preview: rn type goes before the
function name. If the function is not a void function, then the code inside the function must use
r t r somew here, returning a value of the proper type. A void function does not need the
r t r command; it can include the r t r command (this causes the function to finish) but
cannot use r t r to return a value.
A function may have arguments. But it need not. A function that has no arguments has empty
parentheses. A function that has two i targuments would have i t x i t yin the parentheses.
The xand yare usually not typed in the function prototype (though they can be). The xand y should be included, however, when the function is being defined.
The xand yvariable names exist only inside the function. Assume a function is called a dand it
takes two i targuments. This is what it looks like:
n d(n , n )
} Then when the function is called (say, from some code in m i ( ), two integer values must be
provided: a d 4 1 )(the resul...
View Full Document
This note was uploaded on 05/23/2013 for the course CSE 203 taught by Professor Eckroth during the Spring '10 term at Ohio State.
- Spring '10