C++????????Щ?????????????麯???????
?????hackbuteer1 ???????[ 2016/12/23 14:36:16 ] ????????.NET ???????????
?????????????????????麯?????У????????????????????????????????????????????????????????????????
????1?????C++??????????????麯????
???????????????????????????overload???????override????????麯?????????????????????????????????????
????2?????C++????????????麯????
??????????????????????????????????????????????????????????????????????????????????virtual function???????????????????????????????????????????virtual????????????????????????????????????????в???????????virtual????????????????????????????????????
????3?????C++??????????????????麯????
??????????????????????????????????????????????????????????????麯??????????к??????????????????????????????????????????????inline??????????????????麯????????????????????????
????4?????C++????????????????麯????
??????????????????????????????????????????????е???????????????????????????????????
????5?????C++??????????????麯????
???????C++???????????????У???????м??????????????麯?????????
????*********************************************************************
????1???????????????????????????????麯??????麯???????з?????????????????????????????????????????????е??
????2??????????
??????1???????????????У?????????????virtual??????
??????2?????????????????????????????????????????????????????????????????????????????virtual????????????????????????????????????????????????в?????????????
#include <iostream>
using namespace std;
class B
{
public:
B() {}
virtual void show()
{
cout<<"***"<<endl;
}
};
class D:public B
{
public:
D() {}
void show()
{
cout<<"==="<<endl;
}
};
int main(void)
{
B *pb;
D d; //?????????
pb=&d;
pb->show(); //????????
pb=new D(); //????ù?????
pb->show(); //????
delete pb;
return 0;
}
????3??static?????????????У?????????
????4??????????????????????????????????????????С?
????5??inline??????inline??????virtual????????????????inline?????????????????????????????????????????????滻????virtual??????????????????????????????????inline???????????????????????virtual???????????????????????????????virtual??????????????inline??????
??????
???·???
??????????????????
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