由买买提看人间百态

topics

全部话题 - 话题: derived2
(共0页)
g*****1
发帖数: 998
1
来自主题: JobHunting版 - 请教2道c++的题 (转载)
【 以下文字转载自 Programming 讨论区 】
发信人: guagua1 (), 信区: Programming
标 题: 请教2道c++的题
发信站: BBS 未名空间站 (Tue Jan 10 19:21:47 2012, 美东)
class base{};
class derived{};
class derived2: public base, derived {};
which is true?
1) This is illegal
2) derived2 is derived public from base and private from derived
3) derived2 is derived public from base and public from derived
4) derived2 is derived public from base and protected from derived
class X{
public:
X& operator=(const X& rhs);
const X& operator+(con... 阅读全帖
g*****1
发帖数: 998
2
来自主题: Programming版 - 请教2道c++的题
class base{};
class derived{};
class derived2: public base, derived {};
which is true?
1) This is illegal
2) derived2 is derived public from base and private from derived
3) derived2 is derived public from base and public from derived
4) derived2 is derived public from base and protected from derived
class X{
public:
X& operator=(const X& rhs);
const X& operator+(const X&rhs) const;
const X& operator+(int m);
private:
int n;
};
int main(){
X a, b, c;
system("pause");
... 阅读全帖
(共0页)