?麯???????????????
???????????? ???????[ 2012/8/1 15:52:33 ] ????????
??1????????????????????????????????????????????????????????????????
????2???麯??????????????????????????????????????????????????????????????????
????????a??????????????????????????????????
????????b????????????????????????????????????????????????????????麯??????
#include<iostream>
using namespace std;
class Base{
public:
virtual void f1();
virtual void f2();
virtual void f3();
void f4();
};
class Deriverd:public Base{
public:
virtual void f1();//???麯?????????virtual?????д
void f2(int x); //??Base??f2()????????????????????????
//char void f3(); //??????????????????
void f4();
};
void Base::f1()
{
cout<<"base f1()"<<endl;
}
void Base::f2()
{
cout<<"base f2()"<<endl;
}
void Base::f3()
{
cout<<"base f3()"<<endl;
}
void Base::f4()
{
cout<<"base f4()"<<endl;
}
void Deriverd::f1()
{
cout <<"Deriverd f1()"<<endl;
}
void Deriverd::f2(int x)
{
cout <<"Deriverd f2(int x)"<<endl;
}
//void Deriverd::f3()
//{
// cout<<"Deriverd f3()"<<endl;
//}
void Deriverd::f4()
{
cout <<"Deriverd f4()"<<endl;
}
int main()
{
Base b??*bp;
Deriverd d;
bp=&d;
bp->f1();
bp->f2();
bp->f3();
bp->f4();
return 0;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11