fork(7) download
  1. #include <iostream>
  2. #include <initializer_list>
  3.  
  4. void func(std::initializer_list<int> a_args)
  5. {
  6. for (auto i: a_args) std::cout << i << '\n';
  7. }
  8.  
  9. int main()
  10. {
  11. int a, b, c;
  12. std::cin >> a >> b >> c;
  13.  
  14. func({a, b, c});
  15. }
  16.  
  17.  
Success #stdin #stdout 0s 3300KB
stdin
7 8 9
stdout
7
8
9