在C语言中,结构体的初始化可以通过两种方式进行:
struct Person { char name[20]; int age; }; struct Person p1 = { .name = "Alice", .age = 25 };
struct Person { char name[20]; int age; }; struct Person p2 = {"Bob", 30};