LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Using malloc and getting memory address (http://www.linuxquestions.org/questions/programming-9/using-malloc-and-getting-memory-address-912846/)

southpau1 11-10-2011 09:49 AM

Using malloc and getting memory address
 
Hello-

I am trying to use malloc. I understand that when calling malloc, it returns a pointer to the memory address of the allocated memory.

How would I go about getting the ACTUAL memory address that the pointer is pointing to in the format of 0xc0000000..?

NevemTeve 11-10-2011 10:03 AM

printf ("malloc returned %p\n", p);

southpau1 11-10-2011 10:14 AM

Thank you!!!


All times are GMT -5. The time now is 07:46 AM.