typedef struct
{
string color;
int age;
}Dog;
int main(void)
{
Dog cookie = ("brown", 6);
cookie.color = "blue";
cookie.age = 12;
}
你好,我想知道有没有办法这样编辑多个 struct 值, 同时只使用一行,而不是一遍又一遍地重复"structName.varName".
是否也有类似的方法来更改C中对象的多个值?非常感谢.