VB compiler VS CS compiler

  • Thread starter Thread starter Dave
  • Start date Start date
for (cnt = 0; cnt < 20; cnt++)

this loop runs from 0 to 19, 20 itterations.
For cnt = 0 To 20

This loop runs from 0 to 20, 21 itterations.

All of your loops have this flaw, something to watch out for as in the case
of your test, the problem in each loop level tends to build up exponentially,
in this case you would be running about 100*10000000 extra loops in your VB
code, obviously not good for comparisons (and flat out evil if you are trying
to exactly reproduce code).

For cnt = 0 to 20 is equivalent to for (int cnt=0; cnt<=20; cnt++)

Moving from a 1 based universe to a zero based universe can be annoying
(every time I move from delphi strings to c strings it gives me a headache),
but you gotta watch those details.

- Clinton R. Johnson
 
Back
Top