Laboratory 5: Pointers and String

An object variable contains an object, but a pointer specifies where an object is located. 
In C++, pointers are important for several reasons. 
Pointers can refer to objects that are dynamically allocated whenever they are needed.
Pointers can be used for shared access to objects. 
Furthermore, as you will see, pointers are necessary for implementing polymorphism, 
an  important concept in object-oriented programming.
In C++, there is a deep relationship between pointers and arrays. You will see how this relationship
explains a number of special properties and limitations of arrays.
Finally, you will see how to convert between string objects and char* pointers, which is necessary when
interfacing with legacy code.


Goals:

1. To learn how to declare, initialize, and use pointers
2. To become familiar with dynamic memory allocation and de-allocation
3. To use pointers in common programming situations that involve optional and shares objects
4. To avoid the common errors of dangling pointers and memory leaks
5. To understand the relationship between arrays and pointers
6. To be able to convert between string objects and character pointers

Pointers