【计算机类职业资格】计算机二级(C++)上机考试28及答案解析.doc

上传人:unhappyhay135 文档编号:1337847 上传时间:2019-10-17 格式:DOC 页数:2 大小:31.50KB
下载 相关 举报
【计算机类职业资格】计算机二级(C++)上机考试28及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】计算机二级(C++)上机考试28及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、计算机二级(C+)上机考试 28 及答案解析(总分:-3.00,做题时间:90 分钟)1.改错题 使用 VC6 打开考生文件夹下的工程 test3_1,此工程包含一个源程序文件 test3_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果如下: A:a=5 display1:a=6 display2:a=5 源程序文件 test3_1.cpp 清单如下: #include class A public: /*found*/ A() void printa()couty) t=x; x=y; y=t; coutz) t=x; x=z; z=t; if(yz) t=y; y=z

2、 z=t; coutx/ty/tz解析:本题考查考生对函数重载与引用调用的掌握。这里的重载是使用不同的参数个数,引用调用的形参使用 Vector(Vector int void display(); void set(); Vector(); protected: int size; int *buffer; ; Vector:Vector(int s) / * 1 * Vector:Vector(Vector i“error in index“elem(j)_正确答案:((1) size=s; buffer=new intsize; (2) size=v.size; buffer=new intsize; (3) if (ndx=size) (4) cout“d“解析:本题主要考查考生对于类的构造函数与成员函数定义的掌握,注意(2)中赋值的应用,为了防止重复删除,不能直接将指针赋值,必须使用动态申请 new 建立一块新的空间,并且将原来对象的成员全部复制到新的空间中;(4)中对动态一维数组空间删除的时候,应该使用 delete 关键字,并且不管原数组大小是多少,一律只写一对中括号“加上变量名。

展开阅读全文
相关资源
猜你喜欢
  • DIN 55980-1979 Determination of hue of near white specimens《近似白色试样的比色测定》.pdf DIN 55980-1979 Determination of hue of near white specimens《近似白色试样的比色测定》.pdf
  • DIN 55981-1979 Determination of relative hue of near white specimens《近似白色试样的相对比色测定》.pdf DIN 55981-1979 Determination of relative hue of near white specimens《近似白色试样的相对比色测定》.pdf
  • DIN 55985-1981 Testing of pigments comparison of colour of coloured pigments in full shade system《颜料的检验 对用饱和色方法着色颜料的颜色的比较》.pdf DIN 55985-1981 Testing of pigments comparison of colour of coloured pigments in full shade system《颜料的检验 对用饱和色方法着色颜料的颜色的比较》.pdf
  • DIN 55985-2-1989 Testing of pigments comparison of the colour of pigments in full shade systems black pigments《颜料的检验 全色调系统颜色的比较法 第2部分 黑色颜料》.pdf DIN 55985-2-1989 Testing of pigments comparison of the colour of pigments in full shade systems black pigments《颜料的检验 全色调系统颜色的比较法 第2部分 黑色颜料》.pdf
  • DIN 55987-1981 Testing of pigments determination of hiding power value of pigmented media colorimetric method《颜料的检验 用比色法测定着色介质遮盖力值》.pdf DIN 55987-1981 Testing of pigments determination of hiding power value of pigmented media colorimetric method《颜料的检验 用比色法测定着色介质遮盖力值》.pdf
  • DIN 55988-2013 Determination of indices for the transparency of pigmented and unpigmented systems - Colorimetric method《染色和非染色系统的透明性的测定 比色法》.pdf DIN 55988-2013 Determination of indices for the transparency of pigmented and unpigmented systems - Colorimetric method《染色和非染色系统的透明性的测定 比色法》.pdf
  • DIN 55991-1-2016 Paints and varnishes - Coatings for nuclear facilities - Part 1 Requirements and test methods《色漆和清漆 核设施涂层 第1部分 要求和试验方法》.pdf DIN 55991-1-2016 Paints and varnishes - Coatings for nuclear facilities - Part 1 Requirements and test methods《色漆和清漆 核设施涂层 第1部分 要求和试验方法》.pdf
  • DIN 55991-2-2016 Paints and varnishes - Coatings for nuclear facilities - Part 2 Identity testing of coating materials《色漆和清漆 核设施用涂层 第2部分 涂层材料的鉴定检验》.pdf DIN 55991-2-2016 Paints and varnishes - Coatings for nuclear facilities - Part 2 Identity testing of coating materials《色漆和清漆 核设施用涂层 第2部分 涂层材料的鉴定检验》.pdf
  • DIN 55991-3-2016 Paints and varnishes - Coatings for nuclear facilities - Part 3 Coating work planning and procedure《色漆和清漆 核设施涂层 第3部分 涂覆作业、计划和程序》.pdf DIN 55991-3-2016 Paints and varnishes - Coatings for nuclear facilities - Part 3 Coating work planning and procedure《色漆和清漆 核设施涂层 第3部分 涂覆作业、计划和程序》.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1