O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, fifth edition by Rogers Cadenhead, 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

Hour 12. Creating References

What Is a Reference?

In the past 2 hours, you learned how to use pointers to manipulate objects on the heap and how to refer to those objects indirectly. References, the topic of this hour, give you almost all the power of pointers but with a much easier syntax.

A reference is an alias. When you create a reference, you initialize it with the name of another object, the target. From that moment on, the reference acts as an alternative name for the target, and anything you do ...

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