设为首页 加入收藏

TOP

2.8 Class Types (4)
2013-10-07 15:25:26 来源: 作者: 【 】 浏览:74
Tags:2.8 Class Types

EXERCISES SECTION 2.8

Exercise 2.28: Compile the following program to determine whether your compiler warns about a missing semicolon after a class definition:

  1. class Foo {  
  2. // empty  
  3. // Note: no semicolon  
  4. int main()  
  5. {  
  6. return 0;  

If the diagnostic is confusing, remember the message for future reference.

Exercise 2.29: Distinguish between the public and private sections of a class.

Exercise 2.30: Define the data members of classes to represent the following types:

(a) a phone number (b) an address

(c) an employee or a company (d) a student at a university

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇5.1 Arithmetic Operators (1) 下一篇2.8 Class Types (3)

评论

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

·Java后端面试实习自 (2025-12-25 09:24:21)
·Java LTS版本有哪些 (2025-12-25 09:24:18)
·2025年,JAVA还值得 (2025-12-25 09:24:16)
·用 C 语言或者限制使 (2025-12-25 08:50:05)
·C++构造shared_ptr为 (2025-12-25 08:50:01)