版本15和19间的区别 (跳过第4版)
于2006-06-18 18:04:24修订的的版本15
大小: 1675
编辑: czk
备注:
于2007-07-22 19:54:07修订的的版本19
大小: 1258
编辑: czk
备注:
删除的内容标记成这样。 加入的内容标记成这样。
行号 1: 行号 1:
[[Navigation(slideshow)]] ## page was renamed from Pointers and Arrays
[[Navigation(slides)]]
行号 3: 行号 4:
= Chapter 5 - Pointers and Arrays = = Chapter 5 - Pointers and Arrays 指针与数组 =
行号 10: 行号 11:

 1. ["/5.1 Pointers and Addresses"]
 1. ["/5.2 Pointers and Function Arguments"]
 1. ["/5.3 Pointers and Arrays"]
 1. ["/5.4 Address Arithmetic"]
 1. ["/5.5 Character Pointers and Functions"]
 1. ["/5.6 Pointer Arrays; Pointers to Pointers"]
 1. ["/5.7 Multi-dimensional Arrays"]
 1. ["/5.8 Initialization of Pointer Arrays"]
 1. ["/5.9 Pointers vs. Multi-dimensional Arrays"]
 1. ["/5.10 Command-line Arguments"]
 1. ["/5.11 Pointers to Functions"]
 1. ["/5.12 Complicated Declarations"]
[[Navigation(children)]]
[[Include(^TCPL/5\.[0-9][0-9] .*, , titlesonly)]]
 

Navigation(slides)

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 lead to more compact and efficient code than can be obtained in other ways. Pointers and arrays are closely related; this chapter also explores this relationship and shows how to exploit it.

Pointers have been lumped with the goto statement as a marvelous way to create impossible-to-understand programs. This is certainly true when they are used carelessly, and it is easy to create pointers that point somewhere unexpected. With discipline, however, pointers can also be used to achieve clarity and simplicity. This is the aspect that we will try to illustrate.

The main change in ANSI C is to make explicit the rules about how pointers can be manipulated, in effect mandating what good programmers already practice and good compilers already enforce. In addition, the type void * (pointer to void) replaces char * as the proper type for a generic pointer. Include(^TCPL/5\.[0-9][0-9] .*, , titlesonly)

TCPL/5_Pointers_and_Arrays (2008-05-22 11:43:49由czk编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.