Reputation: 579
I have a string
char value[16]="ffffffffc06e91"
and I need to retrieve the address stored as a string in the variable value.
ie..
void * ptr = NULL;
somefunction(value,ptr); // ptr = 0xffffffffc06e91
Is there such a function or a method to do so ?
Thanks
Upvotes: 0
Views: 23
Reputation: 579
We could use strtol to accomplish this, thanks to @Bwebb for pointing out atoi which led me to strtol.
void * ptr = (void*)(long)strtol(value,NULL,16);
Upvotes: 0