0

In pointer what is (& and *) do?

I know that the (&) refers to the place of variable in the memory OK but what (*) do

7th May 2017, 2:45 PM
Mahmoud Salama
Mahmoud Salama - avatar
2 Antworten
+ 8
while using & operator with both pointer or variable it refers to the address of variable/pointer whereas while * can only be used with pointers and it refers to the value stored at address which is stored in pointer. lets say: int x=10; int *y=&s; now : y will have the address of x. so , if we print &y, then we will get address of y whereas *y will yield 10 as it has address of x stored in it and value of x is 10.
7th May 2017, 3:31 PM
Jain Rishav Amit
Jain Rishav Amit - avatar
0
thanks
7th May 2017, 3:38 PM
Mahmoud Salama
Mahmoud Salama - avatar