Address of operator and deference operator

1.What is the difference between Address of operator(&) and deference operator? Please make it as simple as posible..

2. In the article there is a sentence "The actual address of a variable in memory cannot be known before runtime"
So, What can we do if we want to use the actual address of a variable?
Thx
1.

The address of operator gives you the address of an object.

The dereference operator, applied to a pointer, gives you what that pointer is pointing at.

2.

Given the first line of the answer to (1), what operator do you think needs to be used to get the address of a variable?
1.

the address operator gives address of an object example

we have object x
address of it is 0x876
to access it we put &x

it's called dereference..(I think)
so...it is used to access an object pointed by a pointer..

example

we have a pointer p
p points to address of x
so to access x from p we have to use dereference operator

2.

to access the address you need address operator
Last edited on
Topic archived. No new replies allowed.