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.
by Rebecca — Apr 01
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.