Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

vector int initialize with increasing numbers

#include <iostream> 
#include <vector> 
#include <numeric>
using namespace std;
int main()
{
    vector<int> v(10); 
    iota (begin(v), end(v), 0); 
    for (auto i : v) {
        cout << i << ' ';
    } cout << endl;
    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vector #int #initialize #increasing #numbers
ADD COMMENT
Topic
Name
8+2 =