Computer Science 1037A/B Lecture Notes - Lecture 21: Include Directive

12 views2 pages

Document Summary

Separating class declaration, member function definitions, and the program that uses the class into separate files is considered good design. Place class declaration in a header file that serves as the class specification file. Place member function definitions in a class implementation file. This file should #include the class specification file. A client program (client code, the one that contains the main function) 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. Format: symbol_name is usually the name of the header file, in all capital letters: What should be done inside vs. outside the class. Class should be designed to provide functions to store and retrieve data. In general, input and output (i/o) should be done by functions that use class objects, rather than by class member functions.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents