Suppose S is a structure:
Code:
typedef struct {

   type s1;
   type s2;
// ...
   type sn;
} S;

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