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.

28335两次for循环嵌套程序运行不正常

Other Parts Discussed in Thread: CONTROLSUITE

28335,ccs3.3

在main函数中,有一段代码为:

int i;

int j;

for(i=0;i<100;i++)

{

    for(j=0;j<1000;j++)

        {

           XXXXXX

        }

}

如果j的判别为如上所示,在这段代码后面设定断点,无法执行到后面的语句;

如果j的判别为j<100,程序执行正常。

请教,这是为什么问题导致的,谢谢。

并且做了另一个测试,设定一个1ms计时器,用while判断是否大于某个数值后跳出循环,也会跑飞。

示意程序:

int iCount=0;

int flag =1;

while(flag)

     if(iCount>3000)

             flag=0;

注:iCount在定时器里做iCount++