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