I have a set of fields of different types, I must group them into any data structure. Then I have to pass it to a function and modify the fields the data structure with indexes, like array.
How would I do this? Thanks to everyone.
mytype{
int a;
ushort b;
string c;
}
And I would like to pass this data structure that groups all these fields, it can be class or struct. And Pass this to a function and would like to modify the fields of that instance with indexes, like this:
void function(ref mytype G)
{
G[1] = 1; <= Here G.a should be set to 1
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…