fork(1) download
  1. #include <iostream>
  2.  
  3. typedef int (*P_array_of_5_ints)[5];
  4.  
  5.  
  6. P_array_of_5_ints f() {
  7. int *a = new int[5];
  8. *a = 42;
  9. return (P_array_of_5_ints)a;
  10. }
  11.  
  12. int main()
  13. {
  14. P_array_of_5_ints p = f();
  15. std::cout << (*p)[0] << '\n';
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
42