O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Q&A

Q1:Why are pointers so important?
A1: During this hour you saw how pointers are used to hold the address of objects on the heap and how they are used to pass arguments by reference. In addition, in Hour 13, “Advanced Functions,” you'll see how pointers are used in class polymorphism.
Q2:Why should I bother to declare anything on the heap?
A2: Objects on the heap persist after the return of a function. Additionally, the capability to store objects on the heap enables you to decide at runtime how many objects you need, instead of having to declare this in advance. This is explored in greater depth in Hour 10.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required