I'm new to c++, and recently I tried the following:
list<Someclass> listofobjects;
int Index;
cin >> Index;
Someclass anobject = listofobjects[Index];
As an output I get the following error:
../src/Kasse.h:98:71: error: no match for ‘operator[]’ in ‘((Someclass*)this)->Someclass::listofobjects[((Someclass*)this)->Someclass::Index]’
Does anyone know why? I just can't find a solution for this... Thanks in advance