设为首页 加入收藏

TOP

2.3 Compound Types (3)
2013-10-07 16:18:35 来源: 作者: 【 】 浏览:72
Tags:2.3 Compound Types

EXERCISES SECTION 2.3.1

Exercise 2.15: Which of the following definitions, if any, are invalid Why

(a) int ival = 1.01; (b) int &rval1 = 1.01;

(c) int &rval2 = ival; (d) int &rval3;

Exercise 2.16: Which, if any, of the following assignments are invalid If they are valid, explain what they do.

  1. int i = 0, &r1 = i; double d = 0, &r2 = d;  

(a) r2 = 3.14159; (b) r2 = r1;

(c) i = r2; (d) r1 = d;

Exercise 2.17: What does the following code print

  1. int i, &ri = i;   
  2. i = 5; ri = 10;   
  3. std::cout << i << " " << ri << std::endl;  

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇第6条:当心 C++编译器最烦人的分.. 下一篇2.3 Compound Types (4)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·用 Python 进行数据 (2025-12-25 15:49:09)
·如何学习Python数据 (2025-12-25 15:49:07)
·利用Python进行数据 (2025-12-25 15:49:04)
·Java 学习线路图是怎 (2025-12-25 15:19:15)
·关于 Java 学习,有 (2025-12-25 15:19:12)