Quick read Qiuzong Yan "from the issue to the program" Chapter 1-6 Summary of issues

Chapter I and C language programming

1. Ask a question

计算机程序的编写从问题机器语言发展到汇编语言,再突破到各式各样的高级语言,逐步切合人类的理解力,极大简化了编程。由于英文编程起步早以及方便性,至今基本全部还是在使用英文编程,为什么使用汉字实现编程普及如此困难?(在使用VS编程时,发现软件编码使用的是UTF编码,解码后在窗口显示时所使用的解码是GBK,所以窗口上汉字的显示出现了乱码,因此引发思考)

2. Questions

由于我们所使用的键盘都是输入字母,如果要用中文来写,首先还要通过输入法把那些字母转换成汉字,但是对于英文就不需要这层转化。于是,如果用中文,不得不说别说更容易理解,反而增加了麻烦,降低了效率。也就是说,谁方便快捷就选择谁,科技的发展跟国界和地域都没有太直接的关系,如果中文更好,自然有很多人使用中文。
然而,中文编程虽然很早就出现过,为何却没有流行起来呢。首先,这与我国的计算机的技术有关,中国计算机技术发展相对于美国来说晚了一些。因此我国的编程套路早就形成了,也就是说,早就习惯于使用英文编写。即使能够开发一套中文编程,不仅需要很大的成本,想要拓展也是有一定难度的。而且,编程所需的技术要求也是很高的,我国现有的技术未必能开发出比英文编程更加实用的中文编程。也正因为如此,中文编程在某种程度上制约了我国发展。因为电脑不是中国发明的,编程也同样不是。

Chapter II data object and computing

1. Ask a question

由于自动转换类型,sin(整型参数表达式)时,int型会先自动转成double型,然后再调用sin函数计算,试分析程序执行过程中,在哪些地方发生类型转换?(此问题是看书时文章中发现的,做个小笔记)

2. Questions

虽然参数表达式计算出来的int值能转换成double值后送给sin函数,但参数表达式是在整数类型中计算

Chapter three variables, functions and control structures

1. Ask a question

for循环与while循环的适用场合?这两者谁的运行效率高?(看到for语句与while语句的原理时,虽说内容比较基础,但是我突然想到在软件开发过程中一般会使用更高效、更优质的语句,来提高整个软件的运行效率,由于这两个语句功能相似,所以我想拿出来做个比较)

2. Questions

for循环更适用于循环的开始和结束已知,循环次数固定的;while循环更适合于条件不确定的场合。两者的运行效率暂没有明确说法,依具体应用场景而定。

Chapter four basic programming techniques

1. Ask a question

用enum关键字说明常量有什么好处?(此处属于在我看了书中介绍的enum之后,对enum这个概念仍然不理解,因此借助提问学习一下)

2. Questions

(1)用enum关键字说明的常量由编译程序自动生成,程序员不需要用手工对常量一一赋值。
(2)用enum关键字说明常量使程序更清晰易读,因为在定义enum常量的同时也定义了一个枚举类型标识符
(3)在调试程序时通常可以检查枚举常量,这一点是非常有用的,尤其在不得不手工检查头文件中的常量值时。
 注:用enum关键字说明常量比用#define指令说明常量要占用更多的内存,因为前者需要分配内存来存储常量。

Chapter V Program Structure

1. Ask a question

(1) function prototype? (5.3.5 introduces the function prototype form, application scenarios, etc., triggering curiosity I want to explore the underlying principle of the function prototype)
(2) enter multiple characters at the same time what happens in the input getchar () function? (In the example 5.8.2 encryption and decryption, I found that the use getchar () after entering multiple characters, the characters after the encryption process is simple, you can turn all the output it, and I imagine not the same, and therefore provoke thinking)
after running in the language of the EOF (3) c, how the end of the input? (Used in the book program EOF, but I do not know the effect, it notes make this issue)

2. Questions

(1) First of all, we all know that the role is to give the compiler uses the prototype, so the compiler to check all kinds of things, such as the return type, parameter list, type, etc., then it will look when calling our call whether the prototype declaration . Then use a prototype to solve the problem in the end what is it? Here I am concerned about the content and function related calls. How the function return value. Typically, the function return value is copied to by a register or memory unit to return it. Then, call the function will check the registers or memory unit. Function and return to the calling function must agree in relation to the type of memory cell data stored, so the calling function know how many bytes are going to get and how to interpret these data to take back. And it shows the function prototype return type of the function is invoked, the compiler will then checks whether the return value of a function of receiving calls of the same type, if a different error is reported.
(2) getchar () return value is the ASCII user input. After press Enter twice plurality of character input, character would be stored to the buffer until the press Enter Here, the string will flow sequentially read one character in the character stream.
(3) Press Ctrl + Z, Enter to exit.

Chapter VI sequential combination of data objects: Array

1. Ask a question

6.4.5中提到了sizeof()运算符。从函数外传进来的参数数组,当我在函数里用到sizeof()时,能否利用sizeof运算符,由形式参数出发计算出实际参数数组的大小呢?(在阅读书中例子时发现)

2. Questions

在书中找到一些解答,如下:函数里对数组形参使用sizeof,求出的是这个形参(这是一个局部变量)的大小,而不会是某次调用的实际参数数组的大小。sizeof是编译时处理的运算符,编译后“sizeof 变量名”被实际求出的一个整数值取代。对数组形参的sizeof求出的是一个指针的大小,与实参数组无关。 
对于这个解答后半部分还不理解,后面学完后再回过来看!

Guess you like

Origin www.cnblogs.com/lilei0915lgz/p/11742309.html