+ 1
abstract classes and pure virtual class
https://www.sololearn.com/compiler-playground/cCRXRMikRcAR in this code attack was a pure virtual class. i wanted to turn it into a normal func but it gives no output. where am i doing wrong?
1 Antwort
+ 3
Currently attack is normal function only. that's why calling base class function.
You need to make pure virtual function.
so replays it by
virtual void attack() = 0;
instead of
void attack() {
};