Variable Sized Arrays

  • + 1 comment

    Filling of vector also can be done in the following way:

    a[i].reserve(k); // make room for k elements
        for (int j=0;j<k;j++) {
            cin >> a[i][j]; // and reading them
        }
    
    • + 0 comments

      That reserve() was exectly what I was lacking. Thanks!