fork download
  1. #include <iostream>
  2. #include <array>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. array<int, 10> arr;
  8. int i;
  9.  
  10. for(i=0;i<10;i++) {
  11. arr.at(i-1) = i;
  12. }
  13. return 0;
  14. }
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():  array::at: __n (which is 4294967295) >= _Nm (which is 10)