fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T, size_t sz>
  5. void printArr(T (&arr)[sz])
  6. {
  7. for (auto x : arr)
  8. {
  9. cout << x << endl;
  10. }
  11. }
  12.  
  13. int main() {
  14. int arr[] = {1, 2, 3};
  15. printArr(arr);
  16. return 0;
  17. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1
2
3