fork download
  1. #include <iostream>
  2. using std::cout;
  3. using std::endl;
  4.  
  5. int* foo(int a) {
  6. int b = a;
  7. int* c = &b;
  8. return c;
  9. }
  10.  
  11. int main() {
  12. int* a = foo(5);
  13. cout << *a << endl;
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
5