![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C程序设计语言(英文第2版)Prentice Hall.-.
ai_albert
这个作者很懒,什么都没留下…
展开
-
Chapter 6 - Structures(七)
6.9 Bit-fieldsWhen storage space is at a premium, it may be necessary to pack several objects into a single machine word; one common use is a set of single-bit flags in applications like compiler翻译 2017-09-02 08:29:45 · 153 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(五)
5.6 Pointer Arrays; Pointers to Pointers(指针数组以及指向指针的指针)Since pointers are variables themselves, they can be stored in arrays just as other variables can. Let us illustrate by writing a program t翻译 2017-08-31 09:00:32 · 183 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(四)
5.5 Character Pointers and FunctionsA string constant, written as"I am a string"is an array of characters. In the internal representation, the array is terminated with the null character '翻译 2017-08-31 08:59:56 · 240 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(三)
5.4 Address Arithmetic(地址算术运算)If p is a pointer to some element of an array, then p++ increments p to point to the next element, and p+=i increments it to point i elements beyond where it current翻译 2017-08-31 08:59:21 · 354 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(二)
5.3 Pointers and ArraysIn C, there is a strong relationship between pointers and arrays, strong enough that pointers and arrays should be discussed simultaneously. Any operation that can be achiev翻译 2017-08-31 08:58:40 · 281 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(一)
A pointer is a variable that contains the address of a variable. Pointers are much used in C, partly because they are sometimes the only way to express a computation, and partly because they usually翻译 2017-08-31 08:57:52 · 302 阅读 · 0 评论 -
Chapter 4 - Functions and Program Structure(六)
4.11 The C PreprocessorC provides certain language facilities by means of a preprocessor, which is conceptionally a separate first step in compilation. The two most frequently used features are翻译 2017-08-31 08:57:00 · 265 阅读 · 0 评论 -
Chapter 4 - Functions and Program Structure(五)
4.10 Recursion(递归)C functions may be used recursively; that is, a function may call itself either directly or indirectly. Consider printing a number as a character string. As we mentioned before翻译 2017-08-31 08:56:17 · 595 阅读 · 0 评论 -
Chapter 4 - Functions and Program Structure(四)
4.7 Register VariablesA register declaration advises the compiler that the variable in question will be heavily used. The idea is that register variables are to be placed in machine registers翻译 2017-08-31 08:55:37 · 283 阅读 · 0 评论 -
Chapter 4 - Functions and Program Structure(三)
4.4 Scope Rules(作用域规则)The functions and external variables that make up a C program need not all be compiled at the same time; the source text of the program may be kept in several files, and pr翻译 2017-08-31 08:54:49 · 239 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(六).1
5.7 Multi-dimensional ArraysC provides rectangular multi-dimensional arrays, although in practice they are much less used than arrays of pointers. In this section, we will show some of their pro翻译 2017-09-01 09:52:32 · 186 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(六).2
5.9 Pointers vs. Multi-dimensional ArraysNewcomers to C are sometimes confused about the difference between a two-dimensional array and an array of pointers, such as name in the example above. G翻译 2017-09-01 09:53:32 · 189 阅读 · 0 评论 -
Chapter 6 - Structures(六)
6.8 UnionsA union is a variable that may hold (at different times) objects of different types and sizes, with the compiler keeping track of size and alignment requirements. Unions provide a翻译 2017-09-02 08:29:06 · 168 阅读 · 0 评论 -
Chapter 6 - Structures(五)
6.6 Table LookupIn this section we will write the innards of a table-lookup package, to illustrate more aspects of structures. This code is typical of what might be found in the symbol table manag翻译 2017-09-01 09:59:54 · 239 阅读 · 0 评论 -
Chapter 6 - Structures(四).2
6.5 Self-referential Structures(自引用结构)Suppose we want to handle the more general problem of counting the occurrences of all the words in some input. Since the list of words isn't known in advanc翻译 2017-09-01 09:59:16 · 282 阅读 · 0 评论 -
Chapter 6 - Structures(四).1
6.4 Pointers to StructuresTo illustrate some of the considerations involved with pointers to and arrays of structures, let us write the keyword-counting program again, this time using pointers i翻译 2017-09-01 09:58:40 · 181 阅读 · 0 评论 -
Chapter 6 - Structures(三)
6.3 Arrays of StructuresConsider writing a program to count the occurrences of each C keyword. We need an array of character strings to hold the names, and an array of integers for the counts. O翻译 2017-09-01 09:58:04 · 188 阅读 · 0 评论 -
Chapter 6 - Structures(二)
6.2 Structures and FunctionsThe only legal operations on a structure are copying it or assigning to it as a unit, taking its address with &, and accessing its members. Copy and assignment includ翻译 2017-09-01 09:57:27 · 168 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(八)
5.12 Complicated DeclarationsC is sometimes castigated for the syntax of its declarations, particularly ones that involve pointers to functions. The syntax is an attempt to make the declaration翻译 2017-09-01 09:56:53 · 231 阅读 · 0 评论 -
Chapter 6 - Structures(一)
A structure is a collection of one or more variables, possibly of different types, grouped together under a single name for convenient handling. (Structures are called ``records'' in some languages,翻译 2017-09-01 09:54:42 · 209 阅读 · 0 评论 -
Chapter 5 - Pointers and Arrays(七)
5.11 Pointers to FunctionsIn C, a function itself is not a variable, but it is possible to define pointers to functions, which can be assigned, placed in arrays, passed to functions, returned by翻译 2017-09-01 09:54:08 · 162 阅读 · 0 评论 -
Chapter 4 - Functions and Program Structure(二).2
4.3 External Variables A C program consists of a set of external objects, which are either variables or functions. The adjective ``external'' is used in contrast to ``internal'', which descr翻译 2017-08-31 08:54:15 · 271 阅读 · 0 评论 -
Chapter 4 - Functions and Program Structure(二).1
4.2 Functions Returning Non-integersSo far our examples of functions have returned either no value (void) or an int. What if a function must return some other type? many numerical functions like翻译 2017-08-30 09:20:34 · 220 阅读 · 0 评论 -
Chapter 2 - Types, Operators and Expressions(一).2
2.3 ConstantsAn integer constant like 1234 is an int. A long constant is written with a terminal l (ell) or L, as in 123456789L; an integer constant too big to fit into an int will also be翻译 2017-08-29 21:52:49 · 299 阅读 · 0 评论 -
Chapter 2 - Types, Operators and Expressions(一).1
Variables and constants are the basic data objects manipulated in a program. Declarations list the variables to be used, and state what type they have and perhaps what their initial values are. Oper翻译 2017-08-29 21:51:39 · 226 阅读 · 0 评论 -
前言的闲话以及第一章的入门(七)
1.8 Arguments - Call by ValueOne aspect of C functions may be unfamiliar to programmers who are used to some other languages, particulary Fortran. In C, all function arguments are passed "by val翻译 2017-08-29 21:49:01 · 243 阅读 · 0 评论 -
前言的闲话以及第一章的入门(六)
1.7 FunctionsIn C, a function is equivalent to a subroutine or function in Fortran, or a procedure or function in Pascal. A function provides a convenient way to encapsulate some computation, wh翻译 2017-08-29 21:47:53 · 213 阅读 · 0 评论 -
前言的闲话以及第一章的入门(五)
1.6 ArraysLet is write a program to count the number of occurrences of each digit, of white space characters (blank, tab, newline), and of all other characters. This is artificial, but it permi翻译 2017-08-29 21:46:21 · 276 阅读 · 0 评论 -
前言的闲话以及第一章的入门(四).2
1.5.2 Character Counting(字符计数)#include /* count characters in input; 1st version */main(){ long nc; nc = 0; while (getchar() != EOF) ++nc; pr翻译 2017-08-29 21:44:53 · 580 阅读 · 0 评论 -
前言的闲话以及第一章的入门(四).1
1.5 Character Input and OutputThe model of input and output supported by the standard library is very simple. Text input or output, regardless of where it originates or where it goes to, is deal翻译 2017-08-29 21:42:59 · 182 阅读 · 0 评论 -
欢迎使用CSDN-markdown编辑器
欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl原创 2017-05-11 14:14:05 · 138 阅读 · 0 评论 -
前言的闲话以及第一章的入门(三)
1.3 The for statement#include /* print Fahrenheit-Celsius table */main(){int fahr;for (fahr = 0; fahr printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));}One major ch翻译 2017-08-29 19:32:55 · 207 阅读 · 0 评论 -
前言的闲话以及第一章的入门(八)
1.10 External Variables and ScopeThe variables in main, such as line, longest, etc., are private or local to main. Because they are declared within main, no other function can have direct ac翻译 2017-08-29 21:50:11 · 250 阅读 · 0 评论 -
c之父的英文著作
前言的闲话以及第一章的入门(一) 随便拿起一本关于编程语言的书,你都会发现其少则三四百页,多则上千页,唯独此本只有两三百页,可见其作者语言功底之深厚。闲话不表,先来看看第一章的新手教程吧!Chapter 1 - A Tutorial Introduction1.1 Getting Started1.2 Variables a原创 2017-03-03 22:32:12 · 675 阅读 · 0 评论 -
Chapter 4 - Functions and Program Structure(一)
Functions break large computing tasks into smaller ones, and enable people to build on what others have done instead of starting over from scratch. Appropriate functions hide details of operation fr翻译 2017-08-30 09:19:56 · 257 阅读 · 0 评论 -
Chapter 3 - Control Flow(三)
3.6 Loops - Do-WhileAs we discussed in Chapter 1, the while and for loops test the termination condition at the top. By contrast, the third loop in C, the do-while, tests at the bottom after mak翻译 2017-08-30 09:19:11 · 198 阅读 · 0 评论 -
Chapter 3 - Control Flow(二)
3.4 SwitchThe switch statement is a multi-way decision that tests whether an expression matches one of a number of constant integer values, and branches accordingly.switch语句是一种多路判定语句,它测试表达式是翻译 2017-08-30 09:18:24 · 276 阅读 · 0 评论 -
Chapter 3 - Control Flow(一)
The control-flow of a language specify the order in which computations are performed. We have already met the most common control-flow constructions in earlier examples; here we will complete the se翻译 2017-08-30 09:17:47 · 172 阅读 · 0 评论 -
Chapter 2 - Types, Operators and Expressions(六)
2.12 Precedence and Order of Evaluation(运算符优先级与求值次序)Table 2.1 summarizes the rules for precedence and associativity of all operators, including those that we have not yet discussed. Operators翻译 2017-08-30 09:16:54 · 271 阅读 · 0 评论 -
Chapter 2 - Types, Operators and Expressions(五)
2.10 Assignment Operators and ExpressionsAn expression such asi = i + 2in which the variable on the left side is repeated immediately on the right, can be written in the compressed form翻译 2017-08-30 09:15:39 · 241 阅读 · 0 评论