0
Hey can anybody plzzz explain this problem of pointer,I’m lil confuse about that.
#include <stdio.h> int main() { char *p; p = "hello"; printf("%c",*&*p); return 0; }
3 Réponses
+ 1
For me the answer I got is h what about you?
0
yepp, but i need explanation
0
`*` dereferences a pointer. It turns a pointer into a value.
`&` is the address operator. It turns a value into a pointer.
`*` and `&` are inverses of each other, like `+` and `-`.
So, `*&` cancels out, and `*&*p` is just `*p`.
and `*p` dereferences the `char*` and turns it into `char`, and you see the first character.