is it possible to declare abstract type object of class?

  abstract-data-type, c++, class, function

as you can see the following code a class, i am trying to call class member function by abstract object is it possible?

#include<iostream>
using namespace std;

class A
{
  public:
        
  void function()
  {
    cout << "A class function";
  }

};

int main()
{
    A *obj;
    A a;
    obj = &a;
    obj.function();
 }

Source: Windows Questions C++

LEAVE A COMMENT