伙计们,我是编程新手,我对后增量值的结果感到惊讶,现在我发现并执行下面的代码后感到困惑,如果 for 循环说 1. 初始化 2. 如果为 false 则检查条件终止 3. 递增。i++ 发生在哪里?i 值在哪里等于 1?
int main()
{
int i, j;
for (int i =0; i<1; i++)
{
printf("Value of 'i' in inner loo[ is %d \n", i);
j=i;
printf("Value of 'i' in outter loop is %d \n", j);
// the value of j=i is equals to 0, why variable i didn't increment here?
}
//note if i increments after the statement inside for loop runs, then why j=i is equals to 4226400? isn't spose to be 1 already? bcause the inside statements were done, then the incrementation process? where does i increments and become equals 1?
//if we have j=; and print j here
//j=i; //the ouput of j in console is 4226400
//when does i++ executes? or when does it becomes to i=1?
return 0;
}
如果 Post increment 使用该值并加 1?我迷路了...请解释...非常感谢。