这一章的收获很大 be lumped with = put together cryptic = secret, hidden meaning lexicographically a.字典序的 cavalier a.随便的，傲慢的 [note_1] (*px)++; // 表示px指向的数加1 *px++; // 表示px的下一个地址(数组的下一个元素)的值 *t++ <==> *t, t++; [note_2]arithmetics for pointers: best use within one array, otherwise it will go wrong, badly. type *p; p+n; /* n = 1 for char(8bt), 2 for i...
be lumped with = put together
cryptic = secret, hidden meaning
*t++ <==> *t, t++;
[note_2]arithmetics for pointers:
best use within one array, otherwise it will go wrong, badly.
/* n = 1 for char(8bt), 2 for int&short(16b), 3 for long&float(32b), 4 for double(64b) */
p++; // no type restrictions
/* on PDP-11; other kind of arithmetic operations(comparison, etc.) are illegal */
这就是implicit function declaration的规定啊： If a name that has not been previously declared occurs in an expression and is followed by a left parenthesis, it is declared by context to be a function name, the function is assumed to return an int, and nothing is assumed about its arguments. Furthermore, if a function declaration does not include arguments, as in double atof(); that too is taken...
If one is sure that the elements exist, it is also possible to index backwards in an array; p[-1], p[-2], and so on are syntactically legal, and refer to the elements that immediately precede p. 不保证所有运行环境都允许此类行为。在mac终端上，这种逆向读取array元素的行为会产生警报，而且会出现预料之外的结果。 warning: array index -1 is before the beginning of the array[-Warray-bounds](1回应)
As an specific example, on the UNIX operating system you must create the program in a file whose name ends in ".c", such as hello.c, then compile it with the command cc hello.c If you haven't botched anyting, such as omitting a character or misspelling something, the compilation will proceed silently, and make an executable file called a.out. If you run a.out by typing the command a.out it will...(1回应)
A word of caution: newcomers to C occasionally write = when they mean ==. As we will see in Chapter 2, the result is usually a legal expression, so you will get no warning. 一个好的习惯是把常量放在左边，如 if ('\n' == c) 这样，当你把`==`误写为`=`的时候，编译器会报错。
We are now going to consider a family of related programs for processing character data. You will find that many programs are just expanded versions of the prototypes that we discuss here. 字符或者字符串操作算是使用C所能做到的最简单而有趣的事情。因为C当中的字符串并非immutable，所以给了我们可以操作字符串中单个字符的机会，这就可以做一些有趣的算法了。
We want to get you as quickly as possible to the point where you can write useful programs, and to do that we have to concentrate on the basics: variables and constants, arithmetic, control flow, functions, and the rudiments of input and output. We are intentionally leaving out of this chapter features of C that are important for writing bigger programs. 一本理想的教授编程语言的书就应该以这种方...