I'm not entirely sure what you're asking, but here's a go.
.x = y
is there for the convenience of the programmer. It's so they don't have to remember the exact ordering of the declaration of the struct, and so the struct members can be reordered without breaking code.
These all do the same thing.
Man man1 = { .name = "Bob", .age = 18 }; Man man2 = { .age = 18, .name = "Bob" }; Man man3 = {"Bob", 18 };
They all say to assign "Bob" to the char name[10]
field, and to assign 18 to the char age
field.
Man man4 = { 18,"Bob" };
man4 is different. The order of the arguments matters. man4 assigns 18 to the char name[10]
field and "Bob" to the char age
field resulting in undefined behavior.