手机扫码访问

导航
您当前的位置:首页 > 高教类 > 工学类
问题:

[单选题]Is it possible to replace:是否可以将视频里向量扩容代码中的:vHp答案窝(daanwo.com)-大学作业答案分享平台
for (int i = 0; i < _size; i++) _elem[i] = oldElem[i];vHp答案窝(daanwo.com)-大学作业答案分享平台
in the vector expansion code in the video with: 替代为:vHp答案窝(daanwo.com)-大学作业答案分享平台
memcpy(_elem, oldElem, _size * sizeof(T));vHp答案窝(daanwo.com)-大学作业答案分享平台
P.S.This question involves the relevant knowledge of C++ P.S.本题涉及C++的相关知识vHp答案窝(daanwo.com)-大学作业答案分享平台
AYes, they are equivalent and there will be no problem. 是,二者是等价的,不会有任何问题。vHp答案窝(daanwo.com)-大学作业答案分享平台
BNo, because the range of elemental intervals for the two copies is different. 否,因为二者复制的元素区间范围不同。vHp答案窝(daanwo.com)-大学作业答案分享平台
CNo, because their efficiency are different. 否,因为二者的效率不同。vHp答案窝(daanwo.com)-大学作业答案分享平台
DNo, because whether the latter can achieve the purpose is related to element type T. 否,因为后者能否达到目的与元素类型T有关。
答案解析:

相关问题
关于我们 | 用户指南 | 版权声明 | 给我留言 | 联系我们 | 积分商城 | 答案求助 | 网站地图
Copyright © 2020 www.daanwo.com All Rights Reserved