I'm having a weird issue where the variables i'm declaring that are pushed back to a vector<vector<pixel>>
are not being actually pushed back... Take a look:
vector<pixel> Lignetemp;
for(int j = 0; j < InfoSup.nbL; j++){
Lignetemp.clear();
for(int i = 0; i < InfoSup.nbC; i++){
int Rtemp, Vtemp, Btemp;
cin >> Rtemp;
cin >> Vtemp;
cin >> Btemp;
Lignetemp.push_back({Rtemp,Vtemp,Btemp});
}
Data.push_back(Lignetemp);
}
Pixel is defined as such:
struct pixel{
int R, V, B;
};
The issue is that when I try to print out Data, I get only 0's instead of the values that I cin
Also, I'm coding on both Windows and Linux ( g++ compilers of different versions) and namely on Ubuntu the compiler gives me these sort of warnings:
warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
Do you have an idea about a fix ? Thanks :)