COMPTNG 10A Chapter Notes - Chapter 1: Modular Programming, Test Harness, Function Overloading

67 views3 pages
14 Sep 2017
School
Professor

Document Summary

Tells us function name, how many/what type of inputs, and what it returns. Something you view in terms of its inputs and outputs without any consideration of its internal workings. Consider functions as black boxes: allows separation of concerns (handle one issue at a time) E(cid:454)a(cid:373)ple: (cid:455)ou do(cid:374)(cid:859)t k(cid:374)o(cid:449) ho(cid:449) s(cid:395)(cid:396)t (cid:449)o(cid:396)ks (cid:271)ut that(cid:859)s fi(cid:374)e. A function definition can be provided in another file w/o being #included (. cpp) . h files = header files contain declarations by convention. cpp files = cpp files / source files contain definitions by convention one of the . cpp files must have 1 main function (usually main. cpp) Have global scope = can be accessed at any point. Override information hiding and any notion of scope. Examples = cout and cin functions with no inputs access global variables to be useful type void functions = procedures. Must be initialized as they are defined. Almost exclusively used for function inputs and outputs: via passed by reference.

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