The member function fill() can be used on std::array for changing the values at once post initialization
fill()
std::array
int main() { std::array<int, 3> arr = { 1, 2, 3 }; // change all elements of the array to 100 arr.fill(100); }