0
# include <stdio.h>
int main(){
int y = 5;
int *yPtr;
printf("Address of y veriable: %x \n",&y);
printf("Address stored in yPtr variable: %x \n", yPtr);
printf("Value of y: %d\n", y);
printf("Value of *& yPtr : %x \n", *&yPtr);
printf("Value of &* yPtr : %x \n", &*yPtr);
return 0;
}
At compile time compiler shows the following message:
(format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘int *’ [-Wformat=]
printf("Value of &* yPtr : %x \n", &*yPtr);
~^
%ls).
I wanted because the compiler shows this warning to use %ls
.
But what you hoped would happen when you do
printf("Value of &* yPtr : %x \n", &*yPtr);
? What was the result you had in mind ?– Isac
a hexadecimal result
– Miguel Garcia Silvestre
and what would be the value ? and this value represents what ?
– Isac