我定义了以下结构:
struct Color {
unsigned int r, g, b, a;
};
有没有办法循环其元素,例如:
Color c;
for (unsigned int i "in all struct elements") {
c.i = 0;
}
这样,之后,所有4个unsigned intc
都设置为0?
只需使用类似
Color color;
color = { 0 };
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句