I'm trying to debug my program with a nested loop to print out all the values in a 2d array. I was getting some unexpected behavior from the loop so i commented out some things and added a simple printf.
`int u = 0;
int y = 0;
char m = 'm';
for (u; u < 12; u++)
for (y; y < 5; y++)
//transition[u][x] = &m;
printf("o"); //this nested loop isnt working????
for initial statement doesn't mean anything:
for (y; y < 12; y++)
The first statement is just
y. Which has no side effects so you are not actually resetting
0 after first innermost loop. So from next iteration of outer loop,
y == 5 and the inner loop is not executed at all.
You should do
for (y = 0; y < 12; y++)