CO311: More classes with various member function implementations
Example
animal.h
animal.cpp
driver.cpp
Notes
1
Basic class definition
2
“Inline” function definitions
3
Special “return reference” type
4
friend operator<<
and making it work with
cout
Example
roman.h
roman.cpp
driver.cpp
Notes
1
Mixing “Inline” function definitions with separate implementation
2
returning a string instead of displaying it
3
increment operators (
i++
,
++i
)
4
friend operator<<
and making it work with
cout
Example
length.h
length.cpp
driver.cpp
Notes
1
Putting it all in one place
2
Same thing, but 2 files.
3
Same thing, but 3 files
4
friend operator<<
and making it work with
cout
5
increment operator (
i++
)
6
One multi-purpose data member
7
Use static member to keep track of what gets incremented