0
In pointer what is (& and *) do?
I know that the (&) refers to the place of variable in the memory OK but what (*) do
2 Réponses
+ 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.
0
thanks