This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

变量赋值语句无效 6678,请同行们帮忙看看



例如下情况:
main.c里
include "main.h"
int i,j;
int main()
{
    j=0;
    for(i=0;i<3;i++)
   {
      j++;
   }
   ukk();
}

mian.h里

include "ukk.h"

ukk.c里

void ukk()

{
    int i,j;
    i=j=0;
    for(i=0;i<3;i++)
   {
      j++;
   }
}

问题:main函数和别的函数里的i和j都可以进行赋值为0,然后进入循环,但是ukk这个函数就不行,不知道为什么,一到i的时候,i=521345321(地址是82bb45d8),j=10682378.(地址是82bb45dc),就是很大的一个数,会直接跳出循环。
猜测:是不是因为地址的原因,我看debug下的map函数,ukk.obj(.text)地址是82b9c400,ukk.obj(.text)地址是82bbb0b8,然后有的ukk的函数地址是82b9cc30