fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int &fun()
  5. {
  6. static int x = 10;
  7. /
  8. x++;
  9. return x;
  10. }
  11. int main()
  12. {
  13. int *ptr=&fun();
  14. int *ptr1=&fun();
  15. printf("%d %d \t %d %d",ptr,ptr1,*ptr,*ptr1);
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 3460KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int& fun()':
prog.cpp:7:2: error: expected primary-expression before '/' token
  /
  ^
stdout
Standard output is empty