fill() – fill array

Fills all elements from an array with the specified character.

#include <iostream>
#include <array>
using namespace std;

int main() {
    array<int, 9> myArray[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};

    myArray->fill(1);

    for (int i = 0; i < 9; i++)
        cout << myArray->at(i) << " ";

    return 0;
}
Output
1 1 1 1 1 1 1 1 1