#include
typedef struct _stu {
const char *name;
int number;
} stu;
#define func(...) my_func((struct _stu){__VA_ARGS__})
void my_func(struct _stu ms)
{
printf("%s: %d\n",
ms.name ? : "untitled", ms.number);
}
int main(void)
{
func("three", 3);
func("hello");
func(.name = "zero");
func(.number = 1, .name = "argc",);
func(.number = 42);
my_func((struct _stu){"hello lua", 200});
return 0;
}
阅读(976) | 评论(0) | 转发(0) |