Friday, 30 August 2013

Storing address of buffer in an unsigned integer;

Storing address of buffer in an unsigned integer;

I have a memory buffer whose address i want to store in an unsigned
integer value.
uint8_t* _buff = new uint8_t[1024];
uint64_t* _base_addr = (uint64_t *)_buff;
I want the address of the location pointed by _buff or _base_addr (anyhow
it is the same location) to be stored in say uint32_t value.
So that when i read the value of integer it gives me the address. How can
this be done ?

No comments:

Post a Comment