Maybe this is an easy question question but I would really like to know it for sure.
If I want to store a value, say an int, at a specific address in the memory (at
I beleieve that the best way to achive your goal is implement your own malloc which will allocate 4 bytes more and store size of memory block like:
void* mymalloc(int size) { char* ptr = malloc(size+sizeof(int)); memcpy(ptr, &size, sizeof(int)); return ptr+sizeof(int); }