the array.length() of C++

int num_elements = sizeof things / sizeof (short);
this is a use of the function "sizeof", in use of this function we can stop of crossing the border of the array.
原文地址:https://www.cnblogs.com/henyihanwobushi/p/2671174.html