I have a vector<some struct> obj. Question: which is more efficient or are both methods about the same?
Code:struct mystruct { long quantity; ... // other stuff here }; vector<mystruct> obj; int i; // assum its already set to a valid number ++obj[i].quantity; or this mystruct s& obj[i]; ++s.quantity;