September 1998
Intermediate to advanced
848 pages
20h 13m
English
Pointers? What are they? Basically, a pointer is a variable (or, more generally, a data object) whose value is an address. Just as a char variable has a character as a value and an int variable has an integer as a value, the pointer variable has an address as a value. If you give a particular pointer variable the name ptr, then you can have statements like the following:
ptr = &pooh; /* assigns pooh's address to ptr */
We say that ptr "points to" pooh. The difference between ptr and &pooh is that ptr is a variable, and &pooh is a constant. If you want, you can make ptr point elsewhere:
ptr = &bah; /* make ptr point to bah instead of to pooh */
Now the value of ptr is the address of bah.
To create a pointer variable, ...
Read now
Unlock full access