Answers for "how to call subclass override method in c++"

C++
0

how to call subclass override method in c++

class A {
public:
   virtual void talk() { printf("A\n"); }
   virtual ~A(){}
};

class B: public A {
public:
   // using virtual is not really necessary here, but it's good for clarity.
   virtual void talk() { printf("B\n"); }
};
Posted by: Guest on March-08-2022

Code answers related to "how to call subclass override method in c++"

Browse Popular Code Answers by Language