C++.阅读程序,写出运行结果,求大神学霸
#include<iostream.h>classaa{public:virtualintfunc(){return0;}};运行结果:classtest:publica...
#include <iostream.h>
class aa { public: virtual int func () { return 0; } };
运行结果:
class test: public aa {
public: int func() { return 58; }
};
void main() {
test d; aa& b = d;
cout << b.func() << endl;
cout << b.aa::func() <<
endl;
} 展开
class aa { public: virtual int func () { return 0; } };
运行结果:
class test: public aa {
public: int func() { return 58; }
};
void main() {
test d; aa& b = d;
cout << b.func() << endl;
cout << b.aa::func() <<
endl;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询