Is there a way to find how many values an array has? Detecting whether or not I\'ve reached the end of an array would also work.
For old g++ compiler, you can do this
template char (&helper(T (&)[N]))[N]; #define arraysize(array) (sizeof(helper(array))) int main() { int a[10]; std::cout << arraysize(a) << std::endl; return 0; }