@joachim-sauer : That's not what I read in that link; it's about how to respond to those questions. I was suggesting it, because it would help understanding the question: otherwise I'd ask to specify why length() couldn't be used. If there is some strange reason for that, we might need to take that into account too. But as it is probably homework, we can just take it as a given. So it's not "becasue I don't want to answer that!" but more "what is going on?". See other comments :D
–
NanneFeb 10 '11 at 14:51

The task itself is completely meaningless in the first place, which makes it pretty impossible to give a "good" answer. Having said that: this only hides the .length behind some syntactic sugar ;-)
–
Joachim SauerFeb 10 '11 at 14:44

@Joachim I completely agree, I would never let this code pass review, let alone use it myself :)
–
Nikita RybakFeb 10 '11 at 14:45