Advertisement
trenka

Untitled

Jul 8th, 2020
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. struct arg {
  4.         int a;
  5.         int b;
  6. };
  7.  
  8. static void f(struct arg arg)
  9. {
  10.         printf("a = %d, b = %d\n", arg.a, arg.b);
  11. }
  12.  
  13. #define F(...) f((struct arg){ .a = 1, .b = 2, __VA_ARGS__ })
  14.  
  15.  
  16. int main(void)
  17. {
  18.         F(.a = 10);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement