I want to use vector header file but I guess there is an error in it. I have attached the image file containing the error. When ever I run this code I get the error shown in the image. Please tell me how to resolve it.
#include <iostream>
#include <conio.h>
#include <vector>
using namespace std;
int main()
{
vector<vector<int>> rmat;
vector<int> r = { 1, 2, 3, 4, 5 };
for (int i = 0; i < 3; i++)
for (int j = 0; j < 5; j++)
{
rmat[i][j] = r[j];
}
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 5; j++)
cout << rmat[i][j] << "\t";
cout << "\n";
}
_getch();
return 0;
}