fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. char test[] = "Test";
  5.  
  6. void func(const char * & str)
  7. {
  8. str = &test[0];
  9. }
  10.  
  11. int main() {
  12. const char * mytest;
  13.  
  14. func(mytest);
  15.  
  16. cout << mytest << endl;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
Test