CS246 Lecture Notes - Lecture 21: X Window System, Assignment Problem, Multiple Working

19 views3 pages

Document Summary

November 24 compilation dependencies, bridge pattern, big three revisited, Maybe: castingmotivation: pointers to implementation window. h class xwindow{ If window. h changes, client. cc must be recompiled. Even changes to private members of the header file require a compile of the client code windowimpl. h struct xwindowimpl{ Pimpl idiom generalized to accommodate multiple implementations is the bridge pattern. Classes working together to achieve a given task. The big three:revisited in the presence of inheritance. Destructor: make the base class dtor virtual class book{ string title, author; int numpages; public: class textbook: public book{ string topic; public: Deal with super class first b1 = b2; // asisignment operator is called. Textbook &textbook::operator=(const textbook &other){ this->book::operator=(other); topic = other. topic; return *this; Book *pb1 = new textbook( cs246 , nomair , 200, c++:); Book *pb2 = new textbook( cs136 , adam , 100, c ); *pb1 = *pb2; // assignment operator assigning one object to another.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents