Computer Science 2211A/B Lecture 9: Chapter 9 Functions

75 views1 pages

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)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents