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.
In C++, using the std::array class to declare an array, one can easily find the size of an array and also the last element.
#include
#include
int main()
{
std::array arr;
//To find the size of the array
std::cout<
In fact, array class has a whole lot of other functions which let us use array a standard container.
Reference 1 to C++ std::array class
Reference 2 to std::array class
The examples in the references are helpful.