fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. string s("Test");
  7. cout << s.at(s.size()) << '\n';
  8. return 0;
  9. }
Runtime error #stdin #stdout #stderr 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 4) >= this->size() (which is 4)