Overclock.net banner

1 - 3 of 3 Posts

·
Registered
Joined
·
2,174 Posts
Discussion Starter #1
So I can type

int a1 = 1;
int b1 = 1;
and so on...

Is it possible to have a loop that would create as many ints (or any other type) with custom labels?

Something like...
int x = 0;
string str;
while ( x < y)
{
str = function_that_appends_x's_value_to_letter(x);
int "str" = 0; //this is my main question, I know this wouldn't compile.
x++;
}

I feel like the answer is staring me in the face using dynamic arrays, pointers, or something OR there would never be a real use for such a thing. I'm trying to make a puzzle of sorts, and having this functionality would make the code more "fun" to read.
 
1 - 3 of 3 Posts
Top