fork download
  1. #include <iostream>
  2. #include <cstdarg>
  3. #include <vector>
  4.  
  5. void print_nums(int count, ...)
  6. {
  7. va_list args;
  8. va_start(args, count);
  9. for (int i = 0; i < count; ++i) {
  10. std::cout << va_arg(args, int) << std::endl;
  11. }
  12. va_end(args);
  13. }
  14.  
  15. int main()
  16. {
  17. print_nums(5, 666, 5.3, "asd", std::string("asda"), std::vector<char>());
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 4540KB
stdin
Standard input is empty
stdout
666
2011225540
-1916619680
-1916619712
-1952426176