fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. template <typename typed, size_t n> void f(typed (&a)[n])
  6. {
  7. for (size_t q=0; q<n; ++q)
  8. cout << a[q] << ' ';
  9.  
  10. cout << '\n';
  11. }
  12.  
  13. int main()
  14. {
  15. int a[] = {1, 2, 3, 4, 5};
  16. char s[] = "Just a string";
  17. double b[] = {1.5, 2.75, 4};
  18.  
  19. f(a);
  20. f(b);
  21. f(s);
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
1 2 3 4 5 
1.5 2.75 4 
J u s t   a   s t r i n g