# How should I “read” a dereference operator?

For example, when I look at some code like

int x = 1;
int * y = &x;


I can read it like

x equals 1
y equals the address of x


but how would I "read" something like

*y = 1;


My best guess is

The value at address y equals 1


But I'm wondering if there's a better way to think about it.

• How you read code is up to you. There could be common conventions (which I am unaware of), but you don't have to follow them. Personally I read it "star y equals one". – Yuval Filmus Jan 19 '18 at 14:28
• This interesting questions seems somewhat more appropriate to stackoverflow, or even to English Language & Usage. – Yuval Filmus Jan 19 '18 at 14:28
• @YuvalFilmus I wouldn't ask this kind of technical question on ELU. – David Richerby Jan 19 '18 at 14:32
• I don't think this has much to do with computer science, since it depends completely on the syntax of the language in question. It's also not quite clear what you mean. You read "cat" as "cat" not "a four-legged animal that chases mice" so why do you call it "reading" when you say "the value at address y" instead of "star y"? – David Richerby Jan 19 '18 at 14:34
• read such expressions from right to left.. – user3629249 Jan 19 '18 at 16:55

I always read *y =1 as: assign the value $1$ to the memory location pointed by y.
y is a pointer type variable, so it has an address as a value. It another words, it points to this address. When we want to, indirectly, manipulate the memory area pointed by y we use *y. Hence *y=1 tells that the value $1$ should be stored in the memory location pointed by y.