I know that it\'s a common convention to pass the length of dynamically allocated arrays to functions that manipulate them:
void initializeAndFree(int* anArr
A non-standard way is to use _msize(). Using this function will make your code unportable. Also the documentation is not very clear on wheteher it will return the number passed into malloc() or the real block size (might be greater).
malloc()