Home > Back-end >  The results and analysis of I'm not the same
The results and analysis of I'm not the same

Time:11-12

#include
Void main ()
{
Char c []="ABC";
Int I=0;
Do;
While (c [i++]!='\ 0');
Printf (" % d ", I - 1);
}
I analysis the results should be 2, 3, but the result is a great god took me fly

CodePudding user response:

refer to the original poster for written reply:
# include
Void main ()
{
Char c []="ABC";
Int I=0;
Do;
While (c [i++]!='\ 0');
Printf (" % d ", I - 1);
}
I analysis the results should be 2, but the result is 3, a great god fly me

How to feel you do while there is a problem, the original?

CodePudding user response:

C [3]=='\ 0', end of the cycle, at this moment I==3, but also perform i++, I value into 4,
  • Related