两道笔试题

nwpulipeng nwpulipeng 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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();

...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
nwpulipeng
C++ 语言 65,214 成员 250,514 内容