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
int n[10] = {0}; /*or you can initilize like this also , this will make all the elements 0 in array*/ for(i = 0; i < 10; i++){ if(digit == 1){ n[i] = n[i] + 1; } }
Try this and let me know