Vector problem

I'm writing a program for a competition which uses input from a file and creates output statistics as well as a list of any errors encountered. I'm using a vector for my errors which contains error codes of type int, which are converted by a function using switch(errorType) to strings which are output in a file (error.txt). Even when there are no errors, the program says errorv.size()=2, and when it tries accessing errorv[0] a segfault occurs. Is there anything indicative of what my problem is? Any help would be appreciated, I can probably provide more detailed information, and it's due early in March, so if anyone knows anything please let me know what you think or what you need to know about it so I can fix this soon.
That isn't enough information to even begin to guess. If errorv.size() says 2, but errorv[2] crashes, then it sounds like you have memory corruption going on.
I solved the problem, but it was by removing a line completely unrelated to errorv (or so I thought, I'll have to look back at what I did). Thanks for trying to help though; I still have no idea what was going on, and I don't know what other information I could have given without giving away the whole source for the program, especially given the solution.
Topic archived. No new replies allowed.