D
digital.pardoe
Hi,
I have had a little programming experience with C but not enough to
accomplish what I am trying to do. Nor have I been able to find any
references on the internet regarding what I am trying to do.
Basically, I have a structure, which I am unable to change, inside
this structure are fields of an integer type that have the names: F0,
F1, F2, F3, F4, F5.
All I want to be able to to is iterate through them is something along
the lines of this pseudocode;
for(N, N == 5, N++) {
STRUCTURE.F{N} = SOME_VAL;
}
I think I may need to utilize an array or hash but I'm really not
sure.
Basically I want to append N to the variable name. Is this possible,
is there some other way of doing it?
Thanks,
Alex
I have had a little programming experience with C but not enough to
accomplish what I am trying to do. Nor have I been able to find any
references on the internet regarding what I am trying to do.
Basically, I have a structure, which I am unable to change, inside
this structure are fields of an integer type that have the names: F0,
F1, F2, F3, F4, F5.
All I want to be able to to is iterate through them is something along
the lines of this pseudocode;
for(N, N == 5, N++) {
STRUCTURE.F{N} = SOME_VAL;
}
I think I may need to utilize an array or hash but I'm really not
sure.
Basically I want to append N to the variable name. Is this possible,
is there some other way of doing it?
Thanks,
Alex