oasis (oasis)
我是想在base class 里面,先初始化这个base class的某个data member, 然后定义一个base class pointer, 用一个derived class的object初始化这个指针,初始化的同时,让这个drived class的data member同时也被符值(等于base class中这个data member的值)。

亮晶晶的想法是对的,可是我在derived class CONSTRUCTOR里无法得到 base class的data member 的值?(因为这个base class 和drived class之间没有继承关系)除非传进去一个this, 这样太复杂了。
2002-1-24 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: 问一个C++的问题

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论