One can use designated initializers as shown below (for \"billy\") without issue, but when the same initialization approach is used on dynamic memory things wil
designated initializers
Use a compound literal:
*molly_ptr = ( struct student ){ .name = "molly", .age = 25 };
This is almost identical to:
struct student temp = { .name = "molly", .age = 25 }; *molly_ptr = temp;
You have to write:
*molly_ptr = (struct student){ .name = "molly", .age = 25 };