你们都是怎么搞对象的啊?

来源:百度知道 编辑:UC知道 时间:2024/06/20 17:59:28

//像我这样搞的.
#include <iostream>
using namespace std;

class A
{
public:
virtual void fun_o()
{
std::cout<<"Three blind mice."<<std::endl;
}
virtual void fun_t()
{
std::cout<<"See how they run."<<std::endl;
}
};

class B: public A
{

};

int main(int argc, char* argv[])
{
A a_object;
B b_object ;
a_object.fun_o();
b_object.fun_o();
a_object.fun_t();
b_object.fun_t();

system("pause");
return EXIT_SUCCESS;
}

C++吗?
这儿歌问题太暧昧了

哈哈........这个好象是你跑错地方了吧!

自己追的,哈哈

哪种语言?