View Single Post
  #4   Spotlight this post!  
Unread 21-03-2012, 11:06
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: C++ help: Understanding pointers?

The way I try to teach pointers to our kids is to analogize them to book pages.

If I have a book of 100 blank pages, then a pointer is like me saying "hey george, write something on page 5". That "page 5" is telling george the address that I want him to write to.

A pointer to a pointer would be: "hey george, go to the page number you find on page 5". Whenever you say "page __", that's a pointer. A pointer to a pointer to a pointer would be "hey george, go to the page number you find on the page you found on page 5".

The main problem with this analogy is that 'page' is a term for a related memory concept, but you don't need to learn about that until much much later.