- 81
- 0
- 约1.17万字
- 约 12页
- 2016-05-20 发布于天津
- 举报
几道c笔试题(含参考答案).doc
1.What is displayed when f() is called given the code:class Number {public:string type;
Number(): type(“void”) { }explicit Number(short) : type(“short”) { }Number(int) : type(“int”) { }};void Show(const Number n) { cout n.type; }void f(){short s = 42;Show(s);}a) voidb) shortc) intd) None of the above
2. Which is the correct output for the following codedouble dArray[2] = {4, 8}, *p, *q;p = dArray[0];q = p + 1;cout q – p endl;cout (int)q – (int)p endl;a) 1 and 8b) 8 and 4c) 4 and 8d) 8 and 1
第一个选C;虽然传入的是short类型,但是short类型的构造函数被生命被explicit,也就是只能显示类型转换,不能使用隐式类型转换。第
您可能关注的文档
- unity3d手机游戏开发课程.docx
- Unity3D游戏开发菜鸟快速上手指南.docx
- unix process 管理相关命令及参数.doc
- UnixLinux vsftp(Very Secure FTP).docx
- UNIXLinux实验报告1.doc
- UNIXLinux实验报告3.doc
- UNIX和LINUX-SHELL.ppt
- UNIX和Linux操作系统(第七章).ppt
- UNIX和Linux操作系统(第八章).ppt
- yellow C.doc
- 安全生产管理员能力培训.pptx
- 咽异感症与心理健康促进.pptx
- 咽异感症与扁桃体炎的鉴别.pptx
- 咽异感症与抑郁症的关系.pptx
- 咽异感症与环境污染的关系.pptx
- 《生动的数据》课件-2025-2026学年沪教版(新教材)小学美术三年级下册.pptx
- 《校园微电影宣传策划》教学课件-2025-2026学年人美版(北京)(2024)初中美术七年级下册.pptx
- 《 春华秋实绘花鸟》教学课件-2025-2026学年人美版(北京)(2024)初中美术七年级下册.pptx
- 管理层安全培训策略.pptx
- 《把“大自然”穿在身上》教学课件-2025-2026学年人美版(北京)(2024)初中美术七年级下册.pptx
原创力文档

文档评论(0)