C++抽象编程 Programming Abstracting in C++ 全书笔记(未完结)

此篇文章来源于斯坦福的计算机编程课,

网址:http://web.stanford.edu/class/cs106b/

有作业,课程,讲义,考试题,答案,视频,源码,方便学习。
每次重头开始看书都是看那些基本语法,语法看得太多并没有任何效果,以后不再复习C的基础知识,比如变量,语句,循环看得再多也还是不会面向对象,以后要看深入的的知识。

简单摘抄几个句子。

00. 目录

1. Overview of C++

1.1 Your first C++ program

1.2 The history of C++

1.3 The structure of a C++ program

1.4 Variables

01. C++常见的的命名规则,属性和方法小写开头,类使用大写,单词之间首字母大写。常量全部大写,可以用短划线隔开各个。
In this text, names of variables and functions begin with a lowercase letter, such as limit or raiseToPower. The names of classes and other programmer-defined data types begin with an uppercase letter, as Direction or TokenScanner.
Constant values are written entirely in uppercase, as in PI or HALFJOLLAR. Whenever an identifier consists of serveral English words run together, the usual convention is to capitalize the first letter of each word to make the name easier to read.
Because that strategy doesn't work for constants, programmers use the underscore character to mark the word boundaries.

1.5 Data types

02. 类型
In C++, every data type value has an associated data type. From a formal perspective, a data type is define by two properties: a domain, which is the set of values that belong to that type, and a set of operations, which defines the behavior of that type.

03. 枚举
The syntax for defining an enumerated type is
enum typename {namelist};
Where typename is the name of the new types and namelist is a list of the constants in the domain, separated by commas.

04. 优先级
If two operators have the same precedence, they are applied in the order spcified by their associativity, which indicates whether that operator group to the left or to the right.

1.6 Expressions

1.7 Statements

Summary

Review question

05. 习题

review

1. source file

2. // /* */

3. <>表示系统标准库 " "自己写的头文件

4. const duoble CENTIMETERS_PER_INCH = 2.54;

5. main return 0;

6. 屏幕上换行

7. 名字 类型 数值 范围

8. c f

9. member operator

10. 表示的范围不同

11. 美国字符

12. true false

13. double x; cin >> x;

14. cout << "i = " << i << ", d = " << d << ", c = " << c << ", s = " << s << endl;

15. int 5, int 3, double 4.8, double 18, int 4, int 2

16. unary表示负值,substraction表示减法操作。

17. 去掉小数部分

18.  一种类型转化为另一种类型, type (var)

19. 4

20. var1 += var2

21. ++x 先将x加1再进行操作。

22. short-circuit evaluation 在&&

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值