Can someone help me in C please I got a problem when I set a loop like
for ( index =0; index<4;++index)
It's only repeat the loop 3times and then the program crash what is that pls urgent!
Can someone help me in C please I got a problem when I set a loop like
for ( index =0; index<4;++index)
It's only repeat the loop 3times and then the program crash what is that pls urgent!
show code please
Well if you tell the compiler that the loop needs to run till its less than 4 then it will run, of course till 3. What you need to do is this:
for(index=0; index<=4; ++index)
Your loop counter is fine. It should pass through the loop 4 times.
The problem is inside the loop or elsewhere.
-
share your entire source code with in the for loop