C by Example

Chapter 20 Pointer Storage
C reveals its true power through pointer variables. Pointer variables (or pointers, as they generally are called) are variables that contain addresses of other variables. All variables you have seen so far have held data values. You understand that variables hold various data types: character, integer, floating-point, and so on. Pointer variables contain the location of regular data variables; they in effect point to the data because they hold the address of the data. After you work with pointers for a while, you will find that they are easier to use than arrays (and much more flexible).
This chapter teaches you the following topics:
Pointer declarations
The ''address of" (&) operator
The dereferencing (*) operator
Arrays of pointers

 

Категории