Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdarg.h>
  3.  
  4. union meh {
  5. void *x;
  6. int y;
  7. };
  8.  
  9. void
  10. a(int cmd, ...)
  11. {
  12. va_list ap;
  13. union meh meh;
  14. union meh *meh_ptr;
  15.  
  16. va_start(ap, cmd);
  17. meh = va_arg(ap, union meh);
  18. fprintf(stderr, "%d, %d\n", cmd, meh.y);
  19. va_end(ap);
  20. }
  21.  
  22. int
  23. main(void)
  24. {
  25. union meh meh;
  26.  
  27. meh.y = 42;
  28. a(1, meh);
  29.  
  30. return (0);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement