get memory address of pointer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi, how would i get the memory address of a said pointer in my program? thanks
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top