3 ms·
for (read_string(s); s.len() > 5; read_string()) or just fix the damned read_string function to return the length read. [nevermind s.len() is unlikely to appe
by tedunangst 15y ago
for (read_string(s); s.len() > 5; read_string())
or just fix the damned read_string function to return the length read. [nevermind s.len() is unlikely to appear in C.]
- deleted 15y ago[deleted]
- steve-howard 15y agoSo is class string, so we're really talking about uses for the operator in C/C++. I'd say the for version is better if you can declare the variable in the initialization section (tighter scope), but the while version has you repeat yourself less if the variable's already there.