由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 请教2道c++的题
相关主题
c++面试问题a c++ question
请问c++中操作符可以声明为虚函数吗?operator() overloading 一问
why copy assignment operator returns non-const type?c++ private 问题
【讨论】问一道很简单的C++题。。。。 (转载)问个overloading new operator的问题
c++ 语法用STL map的时候怎么自己定义大小比较的关系
请教一个class design的问题为什么在overloading中,friend <<不能读取private值呢?
size不固定的struct怎么定义呀?C++ template question
why use static function here?c++ iterator 弱问
相关话题的讨论汇总
话题: derived话题: derived2话题: const话题: public话题: base
进入Programming版参与讨论
1 (共1页)
g*****1
发帖数: 998
1
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");
return 0;
}
which one is wrong?
a=c+5;
a=a=b+c;
(a=c+4)=b+2;
a=b+c;
b=a+1;
1 (共1页)
进入Programming版参与讨论
相关主题
c++ iterator 弱问c++ 语法
c++ 得最基本问题请教一个class design的问题
大侠进来看看这个问题size不固定的struct怎么定义呀?
Why should i include .cpp instead of .hwhy use static function here?
c++面试问题a c++ question
请问c++中操作符可以声明为虚函数吗?operator() overloading 一问
why copy assignment operator returns non-const type?c++ private 问题
【讨论】问一道很简单的C++题。。。。 (转载)问个overloading new operator的问题
相关话题的讨论汇总
话题: derived话题: derived2话题: const话题: public话题: base