This topic is now archived and is closed to further replies.


way to get size of an array using something like sizeof?

Recommended Posts

Watch out though -- if you pass arrays to functions as pointers, this trick won''t work inside the functions (it''ll give you 4 bytes for the array size as it will just be a pointer). It''s best to either keep a note of the array size in a variable and pass it around or to use a genuine container class (e.g. std::vector) which will keep an internal note of the size.

Share this post

Link to post
Share on other sites