lec0207-big3 - Todays announcements: MP2 available, due...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Today’s announcements: MP2 available, due 2/11, 11:59p. Lab03 will be continued this week, and it will be graded. DYB today, 3-5p, Siebel 2407.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Operator= the plan: double theRadius; int numAtts; string * attributes; }; // overloaded = _________sphere::operator=(const sphere & rhs){ } int main(){ sphere a, b; // initialize a b = a; return 0; } 250690176 4 wet rocky rotating inhabited 2.5 3 b a Red Juicy crunchy
Background image of page 2
Operator=: class sphere{ public: sphere(); sphere(double r); sphere(const sphere & orig); ~sphere(); private: double theRadius; int numAtts; string * attributes; }; // overloaded = sphere & sphere::operator=(const sphere & rhs){ //protect against re-assignment //clear lhs //copy rhs //return a helpful value } int main(){ sphere a, b; // initialize a b = a; return 0; }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Operator=: (review) class sphere{ public: sphere(); sphere(double r); sphere(const sphere & orig); ~sphere(); private: double theRadius; int numAtts; string * attributes; }; ________ sphere::operator=(______________ rhs){ if (this != &rhs) { clear(); copy(rhs); } //return a helpful value } Why not (*this != rhs) ?
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/26/2012 for the course CS CS 225 taught by Professor Heeren during the Spring '09 term at University of Illinois, Urbana Champaign.

Page1 / 12

lec0207-big3 - Todays announcements: MP2 available, due...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online