find last element of an array c++ code example
Example 1: find last element of an array c++
int arr={1,2,3,4,5,6};
int length=sizeof(arr)/sizeof(int);
int lastElement=aar[length-1];
Example 2: how to get the last value from array in c++
a = [1,2,3,4,5,6,7]
int x = a.size()
// last element of list
a[x-1] // ourput -> 7