TopSladur.com -   -?
Uroci.net - !

C++ .8 (-)

C++ » C++
fix3d   :    : 6942



:

A Program to Illustrate Virtual Functions
ZooAnimal name: Giant Panda
scientific name: Ailuropoda Melaoleuca
we call our friend: Yin YangZoo
Area Location:NorthWest: B1.P:
area BrownSpotsRoom Location: 1001
ZooAnimal name: Red Panda
scientific name: Ailurus fulgens
we call our friend: RockyZoo
Area Location:NorthWest: B1.P:
area BrownSpotsRoom Location: 943
ZooAnimal name: cartoon Bear
scientific name: ursus cartoons
Zoo Area Location:NorthWest: B1:
area Brown
ZooAnimal name: circusZooAnimal

makeList(), , . , .

8-8. draw(), Shape*. , .

8-9. reSize(), Shape& ( ). draw(), reSize() draw() , .

8-10. draw(), Screen.

8-11. save(), Shape ostream restore(), save().



8.3

, . .

, , , , , Panda Raccoon Bear. , - Panda .

class Panda: public Bear, public Raccoon {... }

Panda ZooAnimal Bear Raccoon; Panda . Panda ZooAnimal; :

ZooAnimal(); // base class of Bear
Bear(); // first Panda base
class ZooAnimal(); // base class of Raccoon
Raccoon(); // second Panda base
class Panda(); // derived class constructor is always last

, ZooAnimal:

class ZooAnimal
{ // simplified definition
public:
void locate();
protected:
short zooArea;
};

class Bear : public ZooAnimal { /* ... */ }
class Raccoon : public ZooAnimal { /* ... */ }

Panda ZooAnimal: zooArea, Raccoon, , Bear. 8.1 :



. , . , , .

Panda ZooAnimal. , Panda ZooAnimal. , , , . ( 8.2 )

. (, ). ( ) . , , . , .

, Panda ZooAniaml. .


: «2 3 4 5 6 7 »

,


© . 2006-2008. Created by: Site.bg
: IT | | . | Paparak.bg | | uchenik.com | TRAVEL | | AmAm.bg | . | | AnimeS-bg.com | | | | IT Light | Spodeli.net | - | Dalavera.net | IDG.BG | Teenproblem.net | - | Fresh-BG.com | Hanovete.com | Bulfleet.com | Mythlands.com | Ohoboho.com | .Com | News24 | Setcom.bg | Atol.bg | Elmaz.com | MobileBulgaria.com