fork download
  1. #include <iostream>
  2.  
  3. template <typename T, size_t N>
  4. void func(T (&s)[N]) {
  5. for (size_t i = 0; i != N; ++i) {
  6. std::cout << s[i] << '\n';
  7. }
  8. }
  9.  
  10. int main() {
  11. int array[] = {1, 2, 3};
  12. func(array);
  13. }
Success #stdin #stdout 0s 2728KB
stdin
Standard input is empty
stdout
1
2
3