|
Dynamic variables in C#?
Ok, the only way I can be really clear about this question is to put up a PHP example.
lets say i want to call the function func() on a whole bunch of variables, and they all are named in the following fashion: var1, var2, var3... etc
at compile time, i dont know how many of those variables i have. In php, its something like this:
for( $i = 0; $i < $theNumberOfVariables; $i++ ){
func( ${'var' . $i} );
}
is this possible in C#?
__________________
|