I have read many books and answers on internet saying that if you derefer a pointer then it will give you the value stored there. But if we consider the code:
int x = 3,*ptr;
ptr = &x;
printf("%d",*ptr); /*print value in x*/
printf("%d",sizeof(*ptr));/*gives sizeof of x*/
printf("%u",&*ptr);/*give address of x*/
If dereferencing were to give value stored in x then we would have : sizeof(3) and &3 that does not make sense whatsoever but if it were to return the variable x itself then everything would make sense: &x : gives address of x, sizeof(x) : gives size of x and
printf("%d",x); //print value in x.//
So my question is what does dereferencing a pointer give the object pointed by it or the value stored in the object?