Why not put MyHiddenWord.length() in forloop

Is there any reason he dose not make the funktion call in the forloop like this:

for (int32 i = 0; i < MyHiddenWord.length(); i++);

I was Thinking that it will be faster to write but maybe the code will execute a little slower since the fore loop need to cal the string memberfunction length() each iteration through the loop and I suspect that is slower than just comparing two variables.

Am I correct?

Privacy & Terms