In C, I have declared a memory area like this:
int cells = 512;
int* memory = (int*) malloc ((sizeof (int)) * cells);
And I place myself more or less in the middle
int* current_cell = memory + ((cells / 2) * sizeof (int));
My question is, while I increment *current_cell
, how do I know if I reached the end of the allocated memory area?