fork(1) download
  1. #define _GLIBCXX_DEBUG 1
  2. #define _GLIBCXX_DEBUG_PEDANTIC 1
  3. #define _FORTIFY_SOURCE 2
  4.  
  5. #include <bits/stdc++.h>
  6.  
  7. int main() {
  8. std::vector<int> arr(3,1);
  9. std::cout << arr[3];
  10. }
Runtime error #stdin #stdout #stderr 0s 4480KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
/usr/include/c++/8/debug/vector:417:
Error: attempt to subscript container with out-of-bounds index 3, but 
container only holds 3 elements.

Objects involved in the operation:
    sequence "this" @ 0x0x7ffd56db0600 {
      type = std::__debug::vector<int, std::allocator<int> >;
    }