3.1 Pointer type

The ``type'' of a pointer specifies the type of the object pointed to by a pointer. Let us consider the following example:

int *pInt;
int **ppInt;
int *intPArray[10];

pInt is a pointer to an integer.

ppInt is a pointer to a pointer to an integer.

intPArray is an array of pointers to integers.

As a result, in order to get to an integer:

Of course, there is no guarantee that any of the examples will actually resolve to a valid location that is supposed to be used as an integer. Nonetheless, the compiler will treat the location as an integer.



Copyright © 2006-08-30 by Tak Auyeung