Lets say we have a struct
Struct myStruct
{
int var1;
int var2;
string var3;
.
.
}
Is it possible to to iterate through the structure's members by maybe using foreach? I have read some things on reflection, but I am not sure how to apply that here.
See Question&Answers more detail:osThere are about 20 variables in the struct. I am trying to read values off a file and trying to assign them to the variables but don't want to call file.ReadLine() 20 times. I am trying to access the member variables through a loop