《The C Programming Language》的原文摘录

  • "相对于#define语句来说,它的优势在于常量值可以自动生成。尽管可以声明enum类型的变量,但编译器不检查这种类型的变量中存储的值是否为该枚举的有效值。不过,枚举变量提供这种检查,因此枚举比#define更具优势。此外,调试程序可以以符号形式打印出枚举变量的值"; (查看原文)
    Cennial 2回复 2赞 2012-09-12 15:02:49
    —— 引自第1页
  • 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 to mean that nothing is to be assumed about the arguments of atof; all parameter checking is turned off. This special meaning of the empty argument list is intended to permit older C programs to compile with new compilers. But it’s a bad idea to use it with new programs. If the function takes arguments, declare them; if it takes no arguments, use void. (查看原文)
    RednaxelaFX 1赞 2016-12-20 06:25:56
    —— 引自第72页
  • A character written between single quotes represents an integer value equal to the numerical value of the character in the machine's character set. (查看原文)
    Zane 2012-04-04 14:43:20
    —— 引自第11页
  • The fundamental types are charaters, and integers and floatingpoint number of serveral sizes. The language does not define any storage allocation facility other than static definiction and the stack discipline provided by the local variables of functions, there is no heap or grabage collection. Similarly, C offers only straightfowward, single-thread control flow: tests, loops, grouping and subprograms, but not multiprogramming, parallel operations, synchronization, or coroutines. .. keeping the lalnguage down to the modest size has real benefits. (查看原文)
    [已注销] 2012-08-23 20:14:40
    —— 引自章节:Introduction
  • The only way to learn a new programming language is by writing programs in it. The first program to write is the same for all languages. C functions are like the subroutines and functions of Fortan or the procedures and functions of Pascal. ... "main" is special -- your program begins executing at the beginning of main. Notice that \n represents only a single character. An escape sequence like \n provides a general and extensible mechanism for representing hard-to-type or invisible characters. ... a comment, which in this case explains briefly what that program does. Comments may appear anywhere a blank or tab or newline can. In C, all variables must be delcared before they are used... The range of both int and float depends on the machine you are using. The sizes of these objects ... (查看原文)
    [已注销] 2012-08-29 09:56:10
    —— 引自章节:Chapter 1: A Tutorial Introduc
  • "相对于#define语句来说,它的优势在于常量值可以自动生成。尽管可以声明enum类型的变量,但编译器不检查这种类型的变量中存储的值是否为该枚举的有效值。不过,枚举变量提供这种检查,因此枚举比#define更具优势。此外,调试程序可以以符号形式打印出枚举变量的值"; (查看原文)
    Cennial 2012-09-12 14:54:38
    —— 引自第31页
  • 逗号运算符",",也是C语言优先级最低的运算符,在for语句中经常会用到它。被逗号分隔的一对表达式将按照从左到右的顺序进行求值,各表达式右边的操作数的类型和值即为其结果的类型和值。 (查看原文)
    Cennial 2012-09-15 17:46:11
    —— 引自第52页
  • Chapter 7 describes the standard library, which provides a common interface to the operating system. This library is defined by the ANSI standard. (查看原文)
    penn.z 2013-01-04 14:47:19
    —— 引自第4页
  • 如果程序包含在多个源文件中,而某个变量在file1文件中定义,在file2和file3文件中使用,那么在文件file2和file3中就需要使用extern声明来建立该变量与其定义之间的联系。人们通常把变量和函数的extern声明放在一个单独的文件中(习惯称之为头文件),并在每个源文件的开头使用#include语句把所要用的头文件包含进来。后缀名.h约定为头文件名的扩展名。 (查看原文)
    longsail 2013-01-30 13:01:09
    —— 引自第24页
  • Although variables of enum types may be declared, compilers need not check that what you store in such a variable is a valid value for the enumeration. Nevertheless, enumeration variables offer the chance of checking and so are often better than #define s. (查看原文)
    一条咸鱼 2013-03-04 10:42:46
    —— 引自章节:2.3 Constants - 关于枚举
  • /var/mobile/Applications/EB08C200-B1B8-4FDE-B8E5-2ECA2B4EB979/Documents/fahr.c(2) : error : main : undeclared identifier (查看原文)
    maemo 2013-04-28 23:17:47
    —— 引自第4页
  • In while (expression) statement the expression is evaluated. If it is non-zero, statement is executed and expression is reevaluated. This cycle continues until expression becomes zero, at which point execution resumes after statement. (查看原文)
    一条咸鱼 2013-11-25 20:16:20
    —— 引自章节:3.5 Loops - While and For
  • Rather more surprising, at least at first sight, is the fact that a reference to a[i] can also be written as *(a+i). In evaluating a[i], C converts it to *(a+i) immediately; the two forms are equivalent. (查看原文)
    djFFFFF 2014-04-23 21:09:19
    —— 引自第99页
  • A pointer is a variable that contains the address of a variable. (查看原文)
    K.W. 2014-04-30 14:08:50
    —— 引自第83页
  • the type void * (pointer to void) replaces char * as the proper type for a generic pointer. (查看原文)
    K.W. 2014-04-30 14:08:50
    —— 引自第83页
  • So if c is a char and p is a pointer that points to it, we could represent the situation this way (查看原文)
    K.W. 2014-04-30 14:08:50
    —— 引自第83页
  • Any operation that can be achieved by array subscripting can also be done with pointers.The pointer version will in general be faster but, at least to the uninitiated, somewhat harder to understand. (查看原文)
    K.W. 2014-04-30 14:30:12
    —— 引自第87页
  • The meaning of "adding 1 to a pointer,'' and by extension, all pointer arithmetic, is that pa+1 points to the next object, and pa+i points to the i-th object beyond pa. (查看原文)
    K.W. 2014-04-30 14:36:37
    —— 引自第88页
  • pa and a have identical values. Since the name of an array is a synonym for the location of the initial element, the assignment pa=&a[0] can also be written as pa = a; (查看原文)
    K.W. 2014-04-30 14:42:52
    —— 引自第88页
  • Rather more surprising, at first sight, is the fact that a reference to a[i] can also be written as *(a+i). (查看原文)
    K.W. 2014-04-30 14:42:52
    —— 引自第88页
<前页 1 2 3 后页>