两道笔试题
Which of the following class DOES NOT need a copy constructor?
a.A matrix class in which the actual matrix is allocated dynamically
within the constructor and is deleted within its destructor.
b.A payroll class in which each object is provided with a unique ID.
c.A word class containing a string object and vector object of line
and column location pairs.
d.A library class containing a list of book object.
Which virtual function redeclarations of the Derived class are correct?
a. Base* Base::copy(Base*);
Base* Derived::copy(Derived*);
b. Base* Base::copy(Base*);
Derived* Derived::copy(Base*);
c. ostream& Base::print(int,ostream&=cout);
ostream& Derived::print(int,ostream&);
d. void Base::eval() const;
void Derived::eval();