我需要填充结构的属性 x 和 y。鉴于我有很多成员 (x,y...) 并且每个人都具有相同的属性(读、写等),无论如何我可以用比这更短的方式做到这一点吗?
features.x.Read = GetAttribute(node,"x","Read",HexValue);
features.x.Write = GetAttribute(node,"x","Write",HexValue);
features.x.address = GetAttribute(node,"x","address",HexValue);
features.x.value = GetAttribute(node,"x","value",HexValue);
features.y.Read = GetAttribute(node,"y","Read",HexValue);
features.y.Write = GetAttribute(node,"y","Write",HexValue);
features.y.address = GetAttribute(node,"y","address",HexValue);
features.y.value = GetAttribute(node,"y","value",HexValue);
谢谢