Generally, we declare variable with specific name. int x=1; int life2 = 100;
But what if i want to declare group of variable with some specific index like this x1 , x2, x3, ... x(n) Instead of manually brute force declare int x1,x2,x3,x4,..... x(n); How can i achieve this by not using array or list?
I uncertainly remember this can achieve by using loop and some special syntax like
for(int f1=0;f1<10;f1++)
{
string temp = ""+f1;
int x+temp; //something
.
.
.
}
Please help. Thank you.