what's wrong with this code?

guest ()
class Base {
public:
Base(int initialValue = 0): x(initialValue) {}

private:
int x;
};

class Derived: public Base {
public:
Derived(int initialValue)
: Base(initialValue), y(initialValue) {}

Derived& operator=(const Derived& rhs);

private:
int y;
};

Derived& Derived::operator=(const Derived& rhs)
{
if (this == &rhs) return *this;
y = rhs.y;
return *this;
}
(#158809@0)
2001-8-7 -05:00

回到话题: what's wrong with this code?

回到论坛: HOME枫下论坛枫下论坛主坛加国之约移民留学申请

URL:   
http://www.rolia.net/zh/post.php?f=0&p=158809