This compiles. By default C/C++ compilers assumes only one line should be in the loop body. curly brackets are only need if you want a block of code instead of a single line.