CMPSC 32 Lecture 6: Lecture 6

49 views2 pages
26 Sep 2017
School
Course
Professor

Document Summary

Containment relation that can be represented by indented lists, balanced parentheses/braces, subsets, trees. Compiler needs to know which class (scope) you mean when writing methods. Scope resolution operator tells which class a method is coming from. Scope resolution operator is used after a class name. Linker = called by the compiler to stitch all things together into the final program. Object-based programming = using classes just for encapsulation. Use structs only for objects with public variables and no methods. But you should explicitly state if it"s private or public. Constrain how the state of the program is changed. Whole program (except for garbage collector) is a mutator. For plain objects, assignment means plain member copying. Implicit default constructor has same effect as user-defined constructor with empty body and empty initializer list. Invoked when a pre-existing object (not a pointer) is assigned to another pre-existing one. When class members hold memory, copying gets trickier.

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