CSE 100 Lecture Notes - Lecture 29: Include Directive, Member Variable

76 views5 pages

Document Summary

Occurs when an object is a member variable of another object. It is often used to design complex objects whose members are simpler objects. Then define carpet class and use a rectangle object as a member of a carpet object. 7. 11 separating class specification, implementation, and client code. Separating the class declaration, member function definitions, and the program that uses the class into separate files is considered good design. Place the class declaration in a header file that serves as the class specification file. Name file classname. cpp #include the class specification file. Place member function definitions in a class implementation file. A client program (client code) that uses the class must #include the class specification file and be compiled and linked with the class implementation file. Used to prevent a header file from being included twice. Symbol_name is usually the name of the header file, in all capital letters: What should be done inside vs. outside the class.

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