×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Aug 2003
    Posts
    64

    very strange problem

    Hello everybody,


    I am writing a Symbian program with the Symbian SDK 1.0 for C++ and I encountered a very strange problem :

    In my code, I have a for-loop like this :


    index = 0;

    for( counter = x; counter != y; counter++ )
    {
    array[index] ....
    ...
    ...


    index++;
    }

    Now, y is always bigger than x, everything is defined but here comes the problem. If I write the same loop like this...

    index = -1;

    for( counter = x; counter != y; counter++ )
    {
    index++;

    array[index] ....
    ...
    ...

    }

    ...and let it run on the emulator once again it behaves differently, the result is different. There is quite some code in the loop and I don't know if Symbian has some kind of "limit for code in loops" or whatever...I just don't get why this happens! To say the truth, the loop I wrote above is in yet another loop in which something similar happens...if I move a statement from the very end to the beginning of the loop ( of course keeping the code equivalent ), it behaves differently.

    Is this any kind of Symbian-related problem???

    Can anybody help me???

    Thanks in advance!!

    Victor

  2. #2
    Regular Contributor
    Join Date
    May 2003
    Location
    Nice, France
    Posts
    123
    One of the thing I see different is that after the loop, index will be different. The rest is certainly a logic error in your code...

    Symbian is certainly not different from other OSes in term of loop size capabilities!

    Daniel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×