fork download
  1. #include <iostream>
  2.  
  3. template <typename T, std::size_t N >
  4. void print(T (&arrayref)[N])
  5. {
  6. for (auto i : arrayref)
  7. std::cout << i << " ";
  8. std::cout << std::endl;
  9. }
  10.  
  11. int main()
  12. {
  13. int arr[] = { 1, 2, 3, 4, 5 };
  14. print(arr);
  15. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
1 2 3 4 5