fork download
  1. #include <cstdarg>
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. void print(int sOne, ...) {
  7. va_list arguments;
  8. va_start(arguments, sOne);
  9.  
  10. for (auto i = 0; i < sOne; ++i) {
  11. cout << va_arg(arguments, const char*) << endl;
  12. }
  13. va_end(arguments);
  14. }
  15.  
  16. int main() {
  17. print(3, "first string", "second string", "third String");
  18. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
first string
second string
third String