home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH14 / A140945.WAV (.mp3) < prev    next >
Waveform Audio File Format  |  1993-10-21  |  413.5 KB  |  1 channel  |  11,025 sample rate  |  38 seconds
Transcription: You can think of the traffic signal in this example as a piece of client code. You can think of the different kinds of traffic as objects of classes that are all derived from the same base class. Just as the traffic signal sends the same message to all three kinds of traffic, the client code in a C++ program that uses polymorphism treats objects from different derived classes as if they were objects of the base class. And just as the different kinds of traffic react in their own individual way to the traffic signal, the objects of derived classes react individually to function calls from the c ...