I always wonder if it's correct to say that something like THIS is a "pointer", rather than a "variable":
NSString *fooStr = ...;
Would you call "fooStr" a "pointer" rather than a "variable"? Or is it okay to say both here?
I always wonder if it's correct to say that something like THIS is a "pointer", rather than a "variable":
NSString *fooStr = ...;
Would you call "fooStr" a "pointer" rather than a "variable"? Or is it okay to say both here?
A pointer's data type is always an address. A variable's data type is what you set it to.
Short answer:
A pointer is a variable that contains the location of data memory, whereas a variable contains the data itself.
So you CAN call a pointer a variable, but calling it a pointer is more specific.