May 2017
Intermediate to advanced
590 pages
17h 18m
English
To assign values to a range, use any of the following standard algorithms:
std::vector<int> v(5); std::fill(v.begin(), v.end(), 42); // v = {42, 42, 42, 42, 42}
std::vector<int> v(10); std::fill_n(v.begin(), 5, 42); // v = {42, 42, 42, 42, 42, 0, 0, 0, 0, 0}
Read now
Unlock full access