CIS 181 Intro to Comp Sci
Class 26, May 12, 2005
IMPORTANT DATES:
Fourth Project due: Tuesday May 17th
Final Exam Scheduled for Friday, May 20th, 10:30am-12:30pm
ASSIGNMENT:
Read D&D, in Chapter 9, pages 609-637
Finish up Project 4!
TODAY'S TOPICS
- Another look at the assignment -- more than one way to get extra credit....
let's discuss some different kinds of possibilities!
- More on operator overloading -- a closer look at the string class!
See the directory:
$CLASSHOME/deitel-files/examples/ch08/fig8_5.
-
There are several aspects of this example to note (especially with respect to
objects that have dynamically allocated pieces).
- Header file -- private data
- Overloaded <<, >> operators
- Conversion constructor
- Copy constructor
- Desctrutor
- Overloaded assignment operator (note checking for self-assignment)
- Overloaded += operator -- need to release old space; relationship between
overloaded operators and conversion constructor
- Overloaded !, ==, <
- Defining other overloaded operators in terms of these
- Subscript operators -- one for const and one for non-const objects