Hi everyone, I need a good tutorial about the use and management the library vector within the struct. I need to specifically define a vector "m1" as a member of a structure, then, I define a vector "sub" within my main function as a object of this struct, and define too a integer "lista". The compile it's good, but I need assign some value to m1[i][j], i.e., storage in both indices of the vector "m1". In the following example no compilation errors, however every component "i" of the vector "m1" are equal.
--------------------------------------------------------------------------
#include<iostream>
using namespace std;
--------------------------------------------------------------------------
struct subject {
vector<int> m1;
};
--------------------------------------------------------------------------
int main() {
int i=0, j=0;
int nn=5;
int nb[nn];