G
Gabriel Leblanc
Is it possible to have a pointer that works like this ?
class ship
|
|
-----------------
| |
| |
class cruiser class destroyer
: public ship : public ship
/////////
ship* selectedShip;
if(buttonPressed = 1)
selectedShip = &cruiser1 //Say, have a pointer to an instance of a cruiser
else
selectedShip = &destroyer1 //Say, have a pointer to an instance of a destroyer
Thanks !
class ship
|
|
-----------------
| |
| |
class cruiser class destroyer
: public ship : public ship
/////////
ship* selectedShip;
if(buttonPressed = 1)
selectedShip = &cruiser1 //Say, have a pointer to an instance of a cruiser
else
selectedShip = &destroyer1 //Say, have a pointer to an instance of a destroyer
Thanks !