Changing all array elements at once
suggest changeThe member function fill()
can be used on std::array
for changing the values at once post initialization
int main() {
std::array<int, 3> arr = { 1, 2, 3 };
// change all elements of the array to 100
arr.fill(100);
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents