#include
<algorithm>
void fill (Out first, Out last, T wert) void fill (Exec pol, Out first, Out last, T wert) Out ranges::fill (Range r, T wert) Out ranges::fill (Out first, Out last, T wert)
Füllt den Bereich [first,last) mit dem wert
.
first | Anfang des Bereiches |
last | Ende des Bereiches |
wert | Füllwert |
pol | parallele Ausführungsart |
Rückgabewert: keiner bzw. last
.
#include <algorithm> #include <iostream> int main() { int arr[3]; std::fill(begin(arr), end(arr), 6); std::cout << arr[0] << arr[1] << arr[2] << '\n'; }