C++
#include <iostream>
using namespace std;
class A {
public:
int var1, var2;
A(){
var1 = 10;
var2 = 20;
}
virtual void fun() = 0; // 纯虚函数
};
int main()
{
A ex1; // error: cannot declare variable 'ex1' to be of abstract type 'A'
return 0;
}
阅读量:1200
点赞量:0
收藏量:0