tags:

views:

68

answers:

2

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?

+2  A: 

A pointer's data type is always an address. A variable's data type is what you set it to.

dacracot
+9  A: 

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.

pixel
That's why some people call it _a pointer variable_.
Georg
True. And variable pointer would be something wholly different :)
pixel