// Alternately, use the containers from the STL, e. g. std::array or std::vector.
// These containers behave very similar to standard arrays, but you can query their
// size at runtime, no problem.
std::vector<int> array;
array.pushback(2);
array.pushback(7);
array.pushback(344);
array.pushback(45);
array.pushback(89);
array.pushback(28);
std::size_t length = array.size(); // easy!