Skip to content

Instantly share code, notes, and snippets.

@redbo
Created February 17, 2012 21:27
Show Gist options
  • Save redbo/1855569 to your computer and use it in GitHub Desktop.
Save redbo/1855569 to your computer and use it in GitHub Desktop.
#include <stdio.h>
struct args {
int someval;
int someval2;
char *someval3;
};
void _print_some_stuff(struct args a)
{
printf("%d %d %s\n", a.someval, a.someval2, a.someval3);
}
#define print_some_stuff(stuff) _print_some_stuff((struct args){stuff})
int main(int argc, char **argv)
{
print_some_stuff(.someval2 = 3);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment