0

an output showing the value of a pointer contained a digit x. Why is it so?

Pointer store memory address in hexadecimal An exercise in this app output showing the value of a pointer contained a digit x. Please explain...

16th Mar 2017, 11:15 AM
Ankit Prasad Patel
Ankit Prasad Patel - avatar
1 Resposta
+ 6
I assume that the pointer was dereferenced. for example: int* x; int y = 89; x = &y; printf("%p", x); This would give you the address of y, but if you were to do: int* x; int y = 89; x = &y; printf("%d", *x); You should get 89.
18th Apr 2017, 12:22 PM
SoraKatadzuma
SoraKatadzuma - avatar