CMPT 212
Fall 1997
|
Point * p = new Point; p->move(3.0, 4.0); p->display(); delete p;
Point * p = new Circle; p->move(3.0, 4.0); p->display(); // which "display" function? delete p;
Point * graphobjs[10]; ... for (int i=0; i<10; i++) { graphobjs[i]->setColor(7); }
Point p; Circle c; ... p.display(); c.display();
void myFunc(Point * p) { p->display(); }The function Point::display() will be called.
Point p; Circle c; ... p = c;
Point p; Circle c; ... c = p;
Point p; Circle c; ... p = c;
Point p; Circle c; ... c = p;
Return to lecture notes index |
|
This page is maintained by simpson@cs.sfu.ca. | Last updated on 31 Oct 1997. |