fork download
  1. #include <iostream>
  2.  
  3. static int const* b_ptr = 0;
  4.  
  5. int const* B() {
  6. return &*b_ptr;
  7. }
  8.  
  9. int main() {
  10. int const* b_ptr = B();
  11.  
  12. std::cout << "Called B()" << std::endl;
  13. std::cout << "b_ref: " << *b_ptr << std::endl;
  14.  
  15. return 0;
  16. }
Runtime error #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
Called B()