fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void func(int *&x)
  5. {
  6. static int tb[2]={1,2};
  7. x=tb;
  8. }
  9.  
  10. int main()
  11. {
  12. int *x=0;
  13. func(x);
  14. cout<<x[0]<<' '<<x[1]<<endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1 2