Fill Function

#include<bits/stdc++.h>
using namespace std;
int main()
{
    vector<int>v(10);

    fill(v.begin(), v.end(), -1);

    for(int i=0;i<10;i++)
        cout << v[i] << " ";

    cout << "\n";
    return 0;
}

Comments