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 use references if pointers can do everything references can?
A1: References are easier to use and understand. The indirection is hidden, and there is no need to repeatedly dereference the variable.
Q2:Why use pointers if references are easier?
A2: References cannot be null, and they cannot be reassigned. Pointers offer greater flexibility, but are slightly more difficult to use.

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