Suppose S is a structure:
Is there a way to assign values to myS without referring to s1, s2, ..., sn explicitly, i.e., instead ofCode:typedef struct { type s1; type s2; // ... type sn; } S; S myS;
is something likeCode:myS.s1 = v1; myS.s2 = v2; //... myS.sn = vn;
possible? Thanks!Code:for (int i=1; i<=n; i++) { /* Do something like myS.i = vi */ }