I want to use vector header file but i guess there is a error in it. I have attached the image file containing the error.When ever i run this code i get the image error. Please help 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;
}
Aucun commentaire:
Enregistrer un commentaire