Design Element
Comment on "Intro to C Pointers and Dynamic Memory"
by Peter — Apr 10
This article starts out good, but goes quite astray starting at "arrays of arrays". This way of thinking of "int **p" will lead a programmer into a world of hurt.

"int **p" does not declare an array of arrays, nor a two-dimensional array of integers. It declares a pointer to a pointer (to an int). The biggest difference occurs when you pass "p" as a parameter to something, or try to make an "extern" declaration that references it.

Scott: I'd be glad to discuss this at length with you if you want to email me. A good foundation in pointers can set a programmer up for life; a shaky foundation can ruin him for years.
Back to "Intro to C Pointers and Dynamic Memory"
Design Element

Copyright © Scott Stevenson 2004-2015