Let's say we have a char array:
char pool[1000];
and a pointer
char* ptr;
the pointer stores an address to a block of data in Pool. I want to store this address in the pool and retrieve it as well.
Basically, what I want to do is a linked-list that is embedded in the char array Pool. The reason is that i'm not allowed to create any new variables (globally), and I cant include new headers, among other restrictions.
So the question is : how to I segment and fit a 4 byte address in (let's say) the first 4 elements of pool[] , and how do I retrieve it again for the purpose of modification.
This operation will happen frequently so it needs to be fast...and of course not rely of external functions.