# **[](https://en.cppreference.com/w/cpp/header/array)** provides `std::array`, a fixed-size array wrapper around a C array. It behaves like a container with `.begin()`, `.end()`, `.size()`, but with zero runtime overhead compared to a raw array. Use it whenever you want the safety of STL containers (bounds checking with `.at()`, iterators) on a fixed-size block, without dynamic allocation. ## Example This example creates a fixed-size array, sorts it using standard algorithms, and accesses elements with both raw indexing and bounds-checked `.at()`. ```cpp // compile: g++ -std=c++11 -o arrexample arrexample.cpp // run: ./arrexample // description: use std::array with container operations #include #include #include int main() { std::array arr = {3, 1, 4, 1, 5}; std::sort(arr.begin(), arr.end()); std::cout << "size: " << arr.size() << "\n"; std::cout << "sorted: "; for (int x : arr) std::cout << x << " "; std::cout << "\n"; std::cout << "at index 2: " << arr.at(2) << "\n"; return 0; } ```