I'm a bit stuck on double pointers

Could someone possibly do their own version of double pointers? I tried looking at this example:
http://alumni.cs.ucr.edu/~pdiloren/C++_Pointers/scotty.htm

But I don't get it; I have a cold at the moment and my mind isn't able to think as straight as it should. If you won't do your own example of a double pointer then please could someone narrow down what was in the link above? Thank you.
http://www.cplusplus.com/doc/tutorial/pointers/

Look up in section 'Pointers to pointers'.
I don't have time to go into detail at the moment, but you may get a better understanding if you call them pointers-to-pointers, rather than double pointers.

You need to get your head around the concept first, then the implementation will make more sense. Imagine they're layers of indirection, or maybe entries in a book's index.

A book has pages, with numbers. A page number can be analogous to an int, for example.

In the index, we have a subject, say "Sports cars", which is analogous to a pointer. The index's "Sports Car" entry may point to page 42.

We also have entries in the index which refer to other subjects, not pages directly. So, if we looked up "Ferrari", it may say "See Sports Car". This can be analogous to a pointer-to-a-pointer (or double pointer).

Obviously this example has read-only pointers, but it's just to get the image in your head.

Does that help? Maybe!

Cheers
Jim
That helped. Thanks to you and Veltas!
No worries!
Topic archived. No new replies allowed.