C++ ???ж???????????????????
???????????? ???????[ 2012/10/8 10:15:47 ] ????????
?????????????????????????У?
class stream
{
public:
stream(){cout<<"stream::stream()!"<<endl;}
};
class iistream:public stream
{
public:
iistream(){cout<<"istream::istream()!"<<endl;}
};
class oostream:public stream
{
public:
oostream(){cout<<"ostream::ostream()!"<<endl;}
};
class iiostream:virtual iistream??virtual oostream
{
public:
iiostream(){cout<<"iiostream::iiostream()!"<<endl;}
};
int main(int argc?? const char * argv[])
{
iiostream oo;
};
???????????????
????stream::stream()!
????istream::istream()!
????stream::stream()!
????ostream::ostream()!
????iiostream::iiostream()!
??????????????????乹?????????????????stream??????????????????д??????е????????н????
????stream stream
???? /
????istream ostream
???? /
????iiostream
???????н?????????????iiostream??????????stream?е????????????·??????????????iiostream????????????л??? istream??ostream??vptr???? istream??ostream??????stream???????????iiostream?????????????????stream????????????????????????vptr????????ó?????????????????????????
class stream
{
void f(){cout<<"here!"<<endl;}
}
main()
{
iiostream ii??
ii.f();
}
??????
???·???
??????????????????
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