3 ms·
The problem here is that the for loop in C is a direct generalization of the while loop. In a Pascal-like language like Oberon the bound is only calculated once
by augustk 13y ago
The problem here is that the for loop in C is a direct generalization of the while loop. In a Pascal-like language like Oberon the bound is only calculated once, so
FOR i := 0 TO Strings.Length(s) - 1 DO
...
END
would be equivalent to
lim := Strings.Length(s) - 1;
WHILE i <= lim DO
...
INC(i)
END