fork(7) download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <cctype>
  5. #include <cstdlib>
  6. #include <stdexcept>
  7. #include <initializer_list>
  8.  
  9. using namespace std;
  10.  
  11. string s[10] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
  12.  
  13. string (&f(int i))[10]
  14. {
  15. return s;
  16. }
  17.  
  18. int main(int argc, char *argv[])
  19. {
  20. auto x = f(0);
  21.  
  22. for (const auto it : *x)
  23. cout << it << " ";
  24. cout << endl;
  25. }
  26.  
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
a