C-Style Arrays and std::array
C++ has C-style arrays and the modern std::array container. Prefer std::array for safety.
Example
#include <array>
using namespace std;
// C-style array
int nums[5] = {10, 20, 30, 40, 50};
cout << nums[0] << endl; // 10
nums[2] = 99;
// Size of C array
int size = sizeof(nums) / sizeof(nums[0]); // 5
// std::array (C++11) — safer, knows its size
array<int, 5> arr = {1, 2, 3, 4, 5};
cout << arr.size() << endl; // 5
cout << arr.at(0) << endl; // 1 (bounds-checked)
arr.fill(0); // all zeros
// 2D array
int matrix[3][3] = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
};
cout << matrix[1][2] << endl; // 6 