I have some integer variables, I named them n0 to n9. I want to access them using a loop. I tried this code to do that:
n0
n9
int n0 = 0, n1
The right way to do it is to declare an integer array and not 10 different variables:
int n[10];
Now you can access 10 int variables with n[0] through n[9].
n[0]
n[9]