cc-june30

cc-june30 - The getName() and getRating() routines within...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 246 (Spring 2011) Comments and corrections for Thurs June 30 (Section 001) ======================================================== Correction to slides 16 and 17 ------------------------------ These slides refer to the displayRating routine below: void displayRating(Game &g) { cout << "Rating for " << g.getName() << " is " << g.getRating() << endl; } In the following example: ElectronicGame e; BoardGame b("Monopoly", 3, 62); displayRating(e); displayRating(b);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The getName() and getRating() routines within the base class Game will be called, *not* the routines within ElectronicGame and BoardGame. The reason is because getName and getRating are not declared virtual in the Game class. This point was emphasized many times during the July 5th and July 7th lectures, but I am posting this correction in case you missed these two lectures, as this is an important point to correct in your notes....
View Full Document

This note was uploaded on 12/08/2011 for the course CS 246 taught by Professor Wormer during the Spring '08 term at Waterloo.

Ask a homework question - tutors are online