相关疑难解决方法(0)

错误:调用纯虚方法 - 在没有活动异常的情况下调用终止 - 中止

在我的Ah文件中:

class A{
  private:
    unsigned short PC;
  public:
    A():PC(0){}
    virtual ~A(){}
    virtual void execute(unsigned short PC)=0;
};
Run Code Online (Sandbox Code Playgroud)

在我的Bh文件中:

class B:public A{
  private: 
      int status;bool exe;
  public:
    B:status(0),exe(false){}
    virtual B(){}
    void execute (unsigned short PC);
};
Run Code Online (Sandbox Code Playgroud)

在我的B.cpp文件中:

#include <iostream>
#include "B.h"

void B::execute (unsigned short PC){
  cout << "Run";
}
Run Code Online (Sandbox Code Playgroud)

在我的Functions.h文件中:

#include "A.h"

class Functions{
  public: 
    int status;
    Functions():status(1){} // this is a constructer
    void run(A *a);
};
Run Code Online (Sandbox Code Playgroud)

在我的Functions.cpp文件中:

#include "Functions.h"
#include "A.h"
#include "B.h"

using namespace std;
void Functions::run (A …
Run Code Online (Sandbox Code Playgroud)

c++

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

c++ ×1