lpcware

placing an array at a specific mem location

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ECamino on Wed Feb 27 15:11:50 MST 2013
Hi,

I have an api call that returns a pointer and reserves 8 bytes of data.  I later need that pointer for another api call.  But I need to use the reserved data as an array and so I need a way to make an array be at the address given by the pointer.  How do I put the array at the pointer location?

uint8_t * ptr;
uint8_t array[8];

ptr = api_call();
// array = api_call(); doesnt work

// put array[] at address returned by ptr...
// populate array[]

api2_call(ptr)

Thanks,

EC

Outcomes