Question 1

Can you name the special functions a C++ compiler can create implicitly?
tip answer

Question 2

What are the two ways to achieve automatic type conversion from type X to type Y?
tip answer

Question 3

Which of one of these represents an assignment operation?

  1. C c1 = c2;
  2. c3 = c4;
  3. both

tip answer

Question 4

Given the class Qz4:

class Qz4 {
enum{ arr_l=5 };
int *arr; // array of int
int seed;
char *name;
public:
Qz4(char *str, int i) : name(str), seed(i) {
arr = new int[arr_l];
for(int i=0;i<arr_l;arr[i]=seed + i++);
}
~Qz4() {
delete [] arr;
cout << "arr destroyed for " << name << endl;
}
void print_arr() {
cout << name << ":" << endl;
for(int i=0;i<arr_l;i++) cout << "Element #" << i << "=" << get_arr(i) << endl;
}
void set_arr(int idx, int val) {
arr[idx]=val;
}
int get_arr(int idx) {
return arr[idx];
}
};

Can you predict the output of the program below?

int main() {
Qz4 q1("Q1",0), q2("Q2",10);
q2=q1;
q1.set_arr(0, 32);
q2.set_arr(1, 56);
q1.print_arr();
q2.print_arr();
}

answer

转载于:https://www.cnblogs.com/rickiedu/archive/2009/05/06/1450867.html

[C++ Quiz] Intermediate level相关推荐

  1. Intermediate Level Attack

  2. docker手册_Docker手册

    docker手册 The concept of containerization itself is pretty old, but the emergence of the Docker Engin ...

  3. 韩国文档的编码方式_像韩国学生学习英语一样学习编码

    韩国文档的编码方式 by Stephen Mayeux 斯蒂芬·马约(Stephen Mayeux) 像韩国学生学习英语一样学习编码 (Learn to code like a Korean stud ...

  4. All about OpenGL ES 2.x – (part 2/3)(转载)

    来源: http://db-in.com/blog/2011/02/all-about-opengl-es-2-x-part-23/ Very welcome back, my friends! No ...

  5. 论文研读:Automatic Temporal Segment Detection and Affect Recognition From Face and Body Display

    摘要:情感的呈现包含一系列的时域分割:开启(onset).峰值(apex).结束(offset).在过去15年中(论文发表于2009年),计算机界对情感识别进行了大量的研究,但是大多数方法都有两点局限 ...

  6. Watch out for these 10 common pitfalls of experienced Java developers architects--转

    原文地址:http://zeroturnaround.com/rebellabs/watch-out-for-these-10-common-pitfalls-of-experienced-java- ...

  7. sybase性能优化经验浅谈

    http://www.2cto.com/database/201204/129094.html 使用sybase数据库多年,有些经验,在数据库部署配置得当,平时监控维护做到位情况下,除此之外数据库的性 ...

  8. sql 12天内的数据_想要在12周内成为数据科学家吗?

    sql 12天内的数据 重点 (Top highlight) I see many ads that claim to make you a data scientist in 12 weeks. T ...

  9. python初学者编程指南_动态编程初学者指南

    python初学者编程指南 编程辅导 (PROGRAMMING TUTORIAL) Dynamic programming is an art, the more problems you solve ...

  10. 深度学习数据自动编码器_如何学习数据科学编码

    深度学习数据自动编码器 意见 (Opinion) When I first wanted to learn programming, I coded along to a 4 hour long Yo ...

最新文章

  1. 程序员大厂不一定要进,算法必须要学!收藏89篇精选算法文章
  2. 《Science》基因组比对的革命性技术
  3. 如何在Git中克隆所有远程分支?
  4. linux上使用git把代码push到gitee上
  5. [LeetCode]题解(python):086-Partition List
  6. 【招聘(上海)】美团酒店招聘 .NET 高级开发
  7. 170630、springboot编程之普通类中调用spring管理的bean对象
  8. oracle 多版本机制,关于oracle多版本机制副作用的问题-Oracle
  9. 中国网吧 20 年往事,端游式微、手游主宰
  10. 腾讯、阿里、搜狐、人人、去哪儿、迅雷等互联网企业产品笔试题目(附个人答案)
  11. CSS 中的@media
  12. 山无棱-天地合-乃敢与君绝
  13. uwe5622 uwe5621ds 紫光展锐 wifi 移植的几个关键点:
  14. 控制面板里卸载软件的入口注册表项
  15. 清华大学c语言程序设计期末试卷,清华大学出版社C语言程序设计习题.doc
  16. 程序员公众号编辑神器-mdnice
  17. 课后实践10:以闲鱼为例,梳理产品功能结构迭代路径
  18. 【实验】虚拟驱动模拟实验
  19. 互联网、因特网及万维网之间的区别与联系
  20. LDA主题模型及案例

热门文章

  1. android获取Mac地址和IP地址
  2. HTML5 网站大观:15个精美的 HTML5 作品集网站实例
  3. HDU today(最短路径)
  4. spring与spring mvc
  5. 【笔记】mac os命令行编译objective-c
  6. 惯性力偶矩公式中j_万众期待的倍量过左峰选股公式,通达信专用,学会收益再翻一倍!...
  7. [JNI] 开发基础(5)内存分配
  8. Gradle之SourceSet
  9. (对拍配套)随机生成数据
  10. Stylus Loader has been initialized using an options object that does not match the API schema.