Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdarg.h>
  2. #include <stdio.h>
  3.  
  4. void vprintargs(int count, ...)
  5. {
  6. // yes I know that vprintf exists :P shh
  7. va_list some_strings;
  8.  
  9. va_start(some_strings, count);
  10. for(int i = 0; i < count; i++)
  11. {
  12. printf("%s", va_arg(some_strings, char*));
  13. }
  14. va_end(some_strings);
  15. printf("\n");
  16. }
  17.  
  18. int main(void)
  19. {
  20. vprintargs(3, "Hello", " World", "!");
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement