O'Reilly logo

C++ How to Program, Sixth Edition by H. M. Deitel - Deitel & Associates, Inc., P. J. Deitel - Deitel & Associates, Inc.

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

Chapter 8. Pointers and Pointer-Based Strings

 

Addresses are given to us to conceal our whereabouts.

 
 --Saki (H. H. Munro)
 

By indirection find direction out.

 
 --William Shakespeare
 

Many things, having full reference

To one consent, may work contrariously.

 
 --William Shakespeare
 

You will find it a very good practice always to verify your references, sir!

 
 --Dr. Routh

OBJECTIVES

In this chapter you’ll learn:

  • What pointers are.

  • The similarities and differences between pointers and references, and when to use each.

  • To use pointers to pass arguments to functions by reference.

  • To use pointer-based C-style strings.

  • The close relationships among pointers, arrays and C-style strings.

  • To use pointers to functions.

  • To declare and use arrays of C-style strings.

Outline ...

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