I am using a void pointer which is assigned to a string. But it is returning me an incorrect address. The way I verified the address of my void pointer was through checking in the elf file. elf file denotes a different address & printf is showing different address.
void *str;
str = "TestString";
printf("%p",str);
Moreover if I use this code twice , it prints the same address. Which makes me believe that it definitely isn't address.
void *str;
str = "TestString";
printf("%p\n",str);
void *str2;
str2 = "TestString";
printf("%p",str2);
Can someone please tell me what exactly is it printing & how can I get the address ?