Hi,
Say that I have three variables, var1, var2, and var3, and I want to do something like this:
When I try to do this it says that 'var' is undeclared - I get why it's not working. My question is, is there any way to refer to a variable this way - where part of the variable name is filled in at runtime with another variable?
Cheers,
Tom
Say that I have three variables, var1, var2, and var3, and I want to do something like this:
Code:
for (int i = 0; i < 2; i++) {
var[i] = i;
}
When I try to do this it says that 'var' is undeclared - I get why it's not working. My question is, is there any way to refer to a variable this way - where part of the variable name is filled in at runtime with another variable?
Cheers,
Tom