Fuck, I've just been searching for a bug in my program for about three quarters of an hour. It ended up just being a single character typo.
I had typed 'Length =+ 2' instead of 'Length += 2'. The thing I can't understand is why GCC allowed it (even with -Wall). I've Googled and it's not a legal operator.
>>6
Yeah, unary + is allowed in C/C++ for symmetry with unary - (negation). That's why it compiles.
I've heard that in ancient, pre-standard C (early 1970s) the += and -= operators were actually written =+ and =- in some implementations, and there was no unary + or -. Thankfully they've changed that.