i tried this code, but it doesnt work, it says vector subscript out of range:
(sorry, i just dont understand how to correctly post code, if someone could tell me, please?)
using namespace std;
if (2 < v.size() && v == 3) cout << "doesnt work.";
i understand why it doesnt work, v doesnt exist. my question is: is there an easier way to check the two conditions than do it one after the other in two different (perhaps nested) if-statements, so that the non-existence of v is checked before it can generate an error?