< Previous | Contents | Next >
Even though references are the preferred way to pass arguments because of their cleaner syntax, you still might need to pass objects through pointers. For example, suppose you’re using a graphics engine that returns a pointer to a 3D object. If you want another function to use this object, you’ll probably want to pass the pointer to the object for efficiency. Therefore, it’s important to know how to pass pointers as well as references.