Arrays..sizeof

Started by
9 comments, last by hammerstein_02 21 years, 8 months ago
quote:Original post by cedricl
Am I the only one who is puzzled by the inability to determine the size of a dynamically-allocated array at run-time? After all, it has to be stored somewhere, for delete[] to work...


Sure it could be stored somewhere , but it is
implementation-defined. The standard does not say anything
about how to store this information. So the conclusion is
that there is no portable way to retrieve this information.
Just use std::vector.



Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!

This topic is closed to new replies.

Advertisement