How do I create variables on the fly in C#

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
Hi, I want to know if it is possible to create variables on the fly. For example can I create variables like varname"i" and have i change according to some condition (in a loop). so in essence I should end up with variables : varname1, varname2, varname3
etc. I need to do this because I want to create arrays at runtime to hold data that have been determined to meet a certain criterion, so a different array will hold data that all satisfy a different condition. Any help would be greatly appreciated.

View the full article
 
Back
Top