Checking size of the array
suggest changeOne of the main advantage of std::array
as compared to C
style array is that we can check the size of the array using size()
member function
int main() {
std::array<int, 3> arr = { 1, 2, 3 };
cout << arr.size() << endl;
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents