5 Pointers

With the wonder concept of references, do we really still need pointers?

Unfortunately, the answer is yes. As we have already discussed earlier, a reference must be determined when it is initialized. Once initialized, a reference cannot change what it refers to.

A pointer (with the exception of a const pointer), however, can change and point to different objects. This flexibility of pointers means that pointers are still useful in C++ programs.


Copyright © 2006-09-19 by Tak Auyeung