Computer Science 1037A/B Lecture Notes - Lecture 21: Include Directive
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.