Assigning algorithms in the C++ Standard Library
The C++ Standard Library provides several algorithms for assigning values to a range (such as a container or a C-array). fill and fill_n std::fill assigns a given value to all the elements in a range. It is available in the header <algorithm>. In the following example all elements of a vector of integers are assigned … Read more