Loading video...
Source Files & OO Samples
- Separate the application into “compilation units”
- Each compilation unit is compiled into an “object” file which can be linked into an application
- Compilation units include a header file to define the unit interface
- Compilation units include a source file to define unit implementation
- Best practice is to include one class, and name the files after it
- This separation allows the implementation to be kept “secret” to avoid misuse by callers
- The source file can be changed without recompiling entire application
- A header might be included in multiple places, which can cause duplicate definitions.
- We learn how to write headers that protect from problems caused by being included multiple times.
- We show the C++ syntax for class definitions
- We show the C++ syntax for class prototypes, saved in the header files, and class implementation, saved in the source files
- Virtual base methods can be used to require derived classes to implement certain methods
- Virtual base methods also allow for inherited Polymorphism, a powerful programming tool
- Here is a link for more information about using classes and polymorphism in C++: http://www.cplusplus.com/doc/tutorial/polymorphism/
Source Files & OO Samples
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview