information you have given is not enough. i couldn't understand what you have posted
and why notlistChoice-=2?
does the system assertion mean you have give a iterator that beyond the range of vector game?
Well that's what I'm not sure of. It sounds like it's telling me that I'm out of range of the number of entries but the expression following games.erase(). The program asks for the user to input entries into the vector and can display the list and ask the user if they want to remove specific items from the list. I'm not using -=2 because that's actually a mistake, I forgot to remove that line after trying both out and I've edited the above but it makes no difference if I keep it as listchoice - 1 or not, it still displays the same assertion.
Well listChoice is 0 even if I change the expression games.erase((games.begin() + (listChoice - 1))); to + 4 instead of -1 (just trying a random number to see the result) and the vector size changes because the user has to put elements into the vector but it's always correct (i.e. if there's 9 elements it will display 9 when size() is output). I'll post the whole code if it will help at all but I'm not sure it will as this is the only part going wrong and it's fairly self contained. I'm just not sure how it's going out of range. The vector I used in my test held 10 elements and I tried to delete the 6th. The way I'm reading this code is that listChoice should = 6, therefore that expression should evalute to 5, or the 6th index in the vector. Am I mad or is something else happening that I'm just not seeing? It'll probably end up being something ridiculously simple but anyway, here's the full program:
The problem is with your conversion. I suppose when you do string to int conversion the second time it is affected be the first one. I was never very good with streams..
Anyway here's a function to fix it:
Okay, I haven't moved onto streams and conversion as such yet so I'll implement this for now and learn all inner workings later but thanks! You've been extremely helpful so I thank you very much for giving me more to think about!