Crashes in C++ Strings

I have seen crashes in C++ strings(STL), why it always dumps in C++ strings??
Can any one answer this??
You are more than likely using them wrong. It is unlikely that string has a bug
in it given that millions of programs use them every day.

Whenever I have a problem with the STL, it is my fault (accessing out of bounds of the vector, etc).
How can a vector go out of bound?? vector is variable length array, right??
prasadi: Vectors don't grow automatically. If the vector is size 4 and you access element 4, the vector will throw an exception. Actually, right now I can't remember if it was the vector that throws the exception or some other lower code, but it makes more sense that vector throws it.
operator[] does not throw but the at member function does. With regards to the OP, some code needs to be posted for us to provide any insight. I would take it a step further and say that the string is definitely not the cause of the crash. It will be the user of the string that is faulty.
Topic archived. No new replies allowed.