This sequence of examples shows the development of a really useful set of member functions
with a class meant to manage military time.
Example Number |
miltime.h |
miltime.cpp |
timetest.cpp |
Goal |
0 |
|
|
|
Beginning case with data-only object and unmanaged manipulation |
1 |
|
|
|
Streamlining with class-specific functions (but not yet members) |
2 |
|
|
|
Additional functions to manipulate the class, but without “binding” the data
members |
3 |
|
|
|
Protecting the data members and manipulating them with “binding” member
functions. |
4 |
|
|
|
Enhancing the constructor to take initialization values |
5 |
|
|
|
Adding two objects together: making it really work with “bound data”
functions. |