C++ ???ж???????????????????
???????????? ???????[ 2012/10/8 10:15:47 ] ????????
?????????????????????????????????????????????????а??????????к??????У???????????public??protected??private????????б????????????ж???c++???????
??????????????????????е??????У?
????????derived ?????base?????derived??base?????“is a”????????derived????base???????????
????????derived ??????base?????derivd??base?????“has a”????????derived??????????base???vptr????ò????Щ?????Щ????????????
??????????п??????????????й????????????????????????????????????????????????????????????????????????????????????????????ν???????????????н??????
class stream
{
public:
stream(){cout<<"stream::stream()!"<<endl;}
};
class iistream:virtual stream
{
public:
iistream(){cout<<"istream::istream()!"<<endl;}
};
class oostream:virtual stream
{
public:
oostream(){cout<<"ostream::ostream()!"<<endl;}
};
class iiostream:public iistream??public oostream
{
public:
iiostream(){cout<<"iiostream::iiostream()!"<<endl;}
};
int main(int argc?? const char * argv[])
{
iiostream oo;
};
???????????е??????????
????stream::stream()!
????istream::istream()!
????ostream::ostream()!
????iiostream::iiostream()!
???????????????????????????????????е????????????г?????????????????????????????????濪???????н????
????stream
????/
????istream ostream
???? /
????iiostream
??????????????ν??????????????????????????
????????? stream ?????????????? virtual ????stream??????????????????istream??ostream????????????????vptr???????????????stream?????????iiostream?????????????????vptr??????stream?е?????????????vptr????????????????????
??????
???·???
??????????????????
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