for loop with a predefined value as counter

507 Views Asked by At

I'm working on my program when I tried a for loop with a predefined integer.

int row = 0;
[...]
//row = 50
for(row = 0; row < y; row++)
{
    [...]
}

For whatever reason, even if I specify that "row = 0;" before the while loop the code just doesn't give a sensible output. This however works just fine:

for(int temprow = 0; temprow < y; temprow++)
{
    row = temprow;
    [...]
}

What gives?

0

There are 0 best solutions below