#include 
<iostream>
using namespace std;

class graphic
{
public:
    
virtual void display()=0;
};

class GIF:public graphic
{
    
public:
        
void display(){    cout << "GIF Image Showing." << endl; }
};

class PIC:public graphic
{
    
public:
        
void display(){        cout << "PIC Image Showing." << endl; }
};

void main()
{
    GIF gif;
    PIC pic;
    gif.display();
    pic.display();

    
bool bGif = typeid(gif) == typeid(GIF);
    
bool bPicEqualGif = typeid(pic) == typeid(GIF);
}

相关文章:

  • 2021-07-11
  • 2021-11-05
  • 2021-06-14
  • 2021-08-12
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
猜你喜欢
  • 2022-01-08
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
相关资源
相似解决方案