Questions tagged [outofrangeexception]

An exception that is thrown because the value of a variable is outside the allowed range

272 questions
-6
votes
2 answers

Access to out of array range does not give any error

Why this: #include using namespace std; int main() { int a[1] = {0}; a[2048] = 1234; cout << a[2048] << endl; return 0; } does not give any compile-time error? (gcc 4.9.3)
vladon
  • 8,158
  • 2
  • 47
  • 91
-10
votes
2 answers

C++ terminate called after throwing an instance of 'std::out_of_range', vector of string

I am getting this error when running: terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr problem is in this part of code but i brand new and i don't understand how i should solve this problem. content…
1 2 3
…
18
19