Why structs cannot be assigned directly?

后端 未结 2 1102
半阙折子戏
半阙折子戏 2021-01-01 10:45

Suppose I have a fully defined struct with tag MyStruct, and suppose that x, y, ..., z are allowed values for its fields. Why is

st         


        
2条回答
  •  粉色の甜心
    2021-01-01 11:38

    You can do this, but you need to supply the type of the structure before your aggregate:

    struct MyStruct q;
    q = (struct MyStruct){x,y,...,z};
    

提交回复
热议问题