In C ++, the shell you are talking about is provided by the standard. If you allocate a memory block with std :: vector , you can use the member function vector :: size () to determine the size of the array and use vector :: capacity () to determine the size of the allocation (which may be different).
C, on the other hand, is a low-level language that leaves such problems managed by the developer, because tracking it dynamically (as you suggest) is not strictly necessary and in many cases will be redundant.
nobar Feb 10 '11 at 17:05 2011-02-10 17:05
source share