Pointers And Memory - Contents
A D V E R T I S E M E N T
No matter how complex a pointer structure gets, the list of rules remains short.
- A pointer stores a reference to its pointee. The pointee, in turn, stores
something useful.
- The dereference operation on a pointer accesses its pointee. A pointer may
only be dereferenced after it has been assigned to refer to a pointee. Most
pointer bugs involve violating this one rule.
- Allocating a pointer does not automatically assign it to refer to a pointee.
Assigning the pointer to refer to a specific pointee is a separate operation
which is easy to forget.
- Assignment between two pointers makes them refer to the same pointee
which introduces sharing.
Back to Table of Contents
A D V E R T I S E M E N T
|
Subscribe to SourceCodesWorld - Techies Talk |
|