Possible Duplicate:
Is there any way to determine the size of a C++ array programmatically? And if not, why?
Can I get the length of a dynamically allocated array in C++, if not, how does C++'s delete operator know how many elements to free.
I searched the forum and found that for dynamically allocated arrays, the length are stored in the four bytes before the array's header or somewhere else. How can I get this value?