Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

3.5. Pointers

Pointers have a reputation for being difficult to learn, but the idea behind them is simple. A pointer works just a like a mirror: you point it at something, and it will simply reflect whatever value it’s pointing at. If you change the value of the thing it refers to, the pointer will reflect that new value. It’s a lot like a Mac file alias or a filesystem link in Unix. Here’s a simple example of a pointer declaration:

int* numberPointer;


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint