Quote:
Originally Posted by Dygear
Isn't it the same as doing this?
Code:
new string[256] = "something long, that's what she said.";
new i = 0, len = strlen(string);
for (; i < len; i++)
//...code
Just wondering if it's different in PAWN then the other languages I use.
|
No, it's not the same. strlen() in that code is not inside the for() so it is not called every iteration. When strlen() is inside the for() the it is called which is slower than just accessing a value from a variable.
__________________