版本16和17间的区别
于2006-06-18 18:23:31修订的的版本16
大小: 1684
编辑: czk
备注:
于2007-07-18 20:06:53修订的的版本17
大小: 1730
编辑: czk
备注:
删除的内容标记成这样。 加入的内容标记成这样。
行号 1: 行号 1:
## page was renamed from Pointers and Arrays

Navigation(slideshow)

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.

  1. ["/5.01 Pointers and Addresses"]
  2. ["/5.02 Pointers and Function Arguments"]
  3. ["/5.03 Pointers and Arrays"]
  4. ["/5.04 Address Arithmetic"]
  5. ["/5.05 Character Pointers and Functions"]
  6. ["/5.06 Pointer Arrays; Pointers to Pointers"]
  7. ["/5.07 Multi-dimensional Arrays"]
  8. ["/5.08 Initialization of Pointer Arrays"]
  9. ["/5.09 Pointers vs. Multi-dimensional Arrays"]
  10. ["/5.10 Command-line Arguments"]
  11. ["/5.11 Pointers to Functions"]
  12. ["/5.12 Complicated Declarations"]

Navigation(children)

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

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