Inheritance & Polymorphism , can some one fill the blanks pls, | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Inheritance & Polymorphism , can some one fill the blanks pls,

___ninjaObj; ___monsterObj; Enemy* e1 =______ ; ______e2 = &monsterObj

8th Jan 2019, 8:59 AM
Manizha Nazari
Manizha Nazari - avatar
1 Answer
+ 2
Your question lacks some info... I think than exists two other class, derived from Enemy (like NinjaEnemy and/or MonsterEnemy). Its hard complete the code without know those classes name. Anyway, the ninjaObj and monsterObj are objects probably of some derived class of Enemy. e1 seem point to one of two (its easy know which because follower statement declare another pointer that point to the other)
8th Jan 2019, 9:10 AM
KrOW
KrOW - avatar