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

'while' vs 'for' loop

Hi all,
Can someone know if there's a differance between loop with 'for' and same one with 'while'?
Is there a differance in code space, time execution and etc?

Thanks a lot,
Robert

Parents
  • It is impossible to give a general answer, as this depends greatly on so many other factors; eg,
    * Whether you count up or down;
    * Which Memory Model you use;
    * The size of your index variable;
    * The loop exit condition;
    * etc, etc, etc...

    You will just have to look at the generated code and see what is best in your particular application.
    Only you can do this.

Reply
  • It is impossible to give a general answer, as this depends greatly on so many other factors; eg,
    * Whether you count up or down;
    * Which Memory Model you use;
    * The size of your index variable;
    * The loop exit condition;
    * etc, etc, etc...

    You will just have to look at the generated code and see what is best in your particular application.
    Only you can do this.

Children