Static struct initialization in C
问题 I have a struct type as shown below: typedef struct position{ float X; float Y; float Z; float A; } position; typedef struct move{ position initial_position; double feedrate; long speed; int g_code; } move; I am trying to statically initialize it, but I have not found a way to do it. Is this possible? 回答1: It should work like this: move x = { { 1, 2, 3, 4}, 5.8, 1000, 21 }; The brace initializers for structs and arrays can be nested. 回答2: C doesn't have a notion of a static-member object of a