I have been trying to initialize an array using vector in C++ and inserting values to it. When I compile the code I get the error as mentioned below.
#include <bits/stdc++.h>
using namespace std;
// Complete the hourglassSum function below.
int hourglassSum(vector<vector<int>> arr) {
int i,j;
int sum=0;
vector<int> vect[16];
vect.insert(vect.begin(),3,5);
return 0;
}
**Solution.cpp: In function 'int hourglassSum(std::vector >)':
Solution.cpp:17:6: error: request for member 'insert' in 'vect', which is of non-class type 'std::vector [16]'
vect.insert(vect.begin(),3,5);
Solution.cpp:17:18: error: request for member 'begin' in 'vect', which is of non-class type 'std::vector [16]'
vect.insert(vect.begin(),3,5);** ^~~~~