I am trying to convert a string such as "0x7ffd01767a60" to hexadecimal so I can compare pointers. Not sure if this is the best decision.
I am doing this:
char *address = "0x7ffd01767a60";
strtol(address,NULL,16);
printf("%lp",address);
And I am getting this: 0x7ffd01764120
EDIT: It seems I was printing the string address ignoring the function return. Thanks Jens! and schlenk.
SOLVED! This is what I do
char *address = "0x7ffd01767a60";
void *p;
unsigned long int address_hex = strtol(address,NULL,16);
p = (void*) address_hex;
printf("%p",p);
printf prints the same memory address.