Is it possible to concatenate variable names in C? Specifically, I have a struct
that contains 6 similar variables in it called class1
, class2
, class3
, etc.
I want to run through a for loop to assign each variable a value, but I can't see how to do it without somehow concatenating the variable name with the value of the for loop counter.
How else could I do this?