0
why we INITIALISE in for loop like int i=1(must with data type) instead we can initialise outside of loop ex- int i=1 C++
4 odpowiedzi
+ 2
Yes. You can as you needed.
int i;
for(I=0;I<5;I++)
{
..
}
for(int I=0;I<5;I++)
{
..
}
int I=0;
for( ; I<5;I++) {.. }
for(;;) {.. }
All valid, but difference is if you declared inside loop then, it will not exist outside of loop..
+ 1
You can do as you like
0
Thnx