Chapter 7

Referring to Your Data Through Pointers

In This Chapter

arrow Using two types of memory: the stack and the heap

arrow Accessing variable addresses through pointers

arrow Creating variables on the heap by using the new keyword

arrow Taking pointers as parameters and returning pointers

arrow Modifying variables the easy way

Where do you live? Don’t say it out loud, because thousands of people are reading this book and you don’t want them all to know. So just think about your address. Most places have some sort of address so that the mail service knows where to deliver your packages and the cable guy can show up sometime between now and 5:00 next Thursday. (So make sure that you’re there.)

Other things have addresses, too. For example, a big corporation in an office building likely has all its cubes numbered. And offices in buildings usually have numbers; and apartments normally have numbers, too.

Now suppose that someone named Sam works in office number 180. Last week, however, Sam got booted out the ...

Get C++ All-in-One For Dummies, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.