get memory address of pointer

  • Thread starter Thread starter Guest
  • Start date Start date
hi, how would i get the memory address of a said pointer in my program?
thanks
--

to get the address the pointer is pointing to:
char ptr[] = "test";
printf("address = %p", ptr);

to get it as a value:
size_t address = (size_t)ptr;

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 
To get any type of useful answer you are going to have to elaborate on what
you mean.
 
Back
Top