Reputation: 40755
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?
Upvotes: 1
Views: 137
Reputation: 5298
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.
Upvotes: 9
Reputation: 22358
A pointer's data type is always an address. A variable's data type is what you set it to.
Upvotes: 2