1// An example of using std::array
2// Basic syntax: std::array<TYPE, SIZE> NAME;
3// Note that the size must be a constant
4
5#include <iostream>
6#include <array> // Use std::array
7
8int main() {
9 std::array<int, 10> arr;
10 arr[0] = 5; // Setting an element
11 std::cout << arr[0] << std::endl; // Element access
12 std::cout << arr.at(0) << std::endl; // Element access with bounds checking
13}