Theocacao
Leopard
Design Element
Comment on "Intro to C Pointers and Dynamic Memory"
by Rebecca — Apr 01
The last time I touched C was 10+ years ago. This is a great refresher.

I was a little puzzled by what you meant in the final example:
//we have to use the star to de-reference

So I added another printf for my own reference:
printf("currentString is %p\n", currentString);

to compare the difference between currentString and *currentString at this point.

Then I realized currentString is just the address (or the ID, using your words), and *currentString is the actual value contained in the reserved space.

Just thought I should point out the obvious for other dummies like myself.
Back to "Intro to C Pointers and Dynamic Memory"
Design Element

Copyright © Scott Stevenson 2004-2015