This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

not able to exit the loop (suggestions urgently required)

hi
all iam working on cygnal mcus .iam using
i=5;
do
{i--;
}while(i!=1);
but this condition is not satisfying when i==1 ;iwant to exit at i=1 but its going in infinite loop kindly help me how to quitfrom
this loop

regards
john e

Parents
  • I had similar problems, the most easyest things won't work. Often caused by data type confusion.

    Ensure that i has an integer type (NOT float) and is not altered by any interrupt routine.

    Take a look at the assembler code in the .lst file and try to understand what happens.

    regards,
    J Lehnhaueser

Reply
  • I had similar problems, the most easyest things won't work. Often caused by data type confusion.

    Ensure that i has an integer type (NOT float) and is not altered by any interrupt routine.

    Take a look at the assembler code in the .lst file and try to understand what happens.

    regards,
    J Lehnhaueser

Children