std_array.cpp (261B)
1 #include <array> 2 #include <iostream> 3 4 int main() { 5 std::array<double, 5> a {1.0, 1.1, 1.2}; 6 std::cout << "Capacity of a: " << a.size() << std::endl; 7 8 a[3] = 1.3; 9 a[4] = 1.4; 10 11 for (auto x : a) 12 std::cout << x << " "; 13 std::cout << std::endl; 14 15 return 0; 16 }