In the one that won't compile, is that length variable an l or a 1 (one)?
It looks like a 1.