4 ms·
Yeah, I think you have to count a semi-colon as a "line of C" for this to be meaningful. It's still awesome none-the-less.
by ghayes 11y ago
Yeah, I think you have to count a semi-colon as a "line of C" for this to be meaningful. It's still awesome none-the-less.
- steckerbrett 11y agofor(i=0;i<4;i++) This is three lines?
- giancarlostoro 11y agoI think he meant outside of for loops in function calls and declarations.
- _lce0 11y agoActually there are two types of ";", expression-separator (the one you mentioned) and statement-separator (the one parent meant) The problem with using those for code metrics is that many systems don't require separators, like `if`, `for` and friends
- a1k0n 11y agoFWIW, most of this code is actually contained inside for loop expressions, since you can chain them together with commas and get away without using any braces. Once that's done it's hard to even count "lines".
- MichaelBurge 11y agoWhy not? It expands to 2 statements and a statement-expression: int i = 0; while (i < 4) { i++; }