Computer Science 2211A/B Lecture 9: Chapter 9 Functions
Document Summary
No functions have the same name in c. No functions have same name *&* parament in c++ Parameter and return value is how function and invoker communicates. Self contained and can be called from anywhere. Local variables initialized to the values that the function is called with. Local variables are declared within the function and can only be used inside the function. Type conversions may occur if type does not match up to function definition. C does not require the function definition to precede its calls. Eg. can put function code after main. Implicit declaration : compiler assumes return value will not throw an error. Because compiler cannot check whether the arguments are proper or not. Function declarations : declare each function before calling it allowing the compiler to see a brief glimpse at the function. Must be consistent with the function"s full definition. Place related functions in a . c file. Place all function prototypes in a . h file (interface)