4 ms·
for(i=0;i<4;i++) This is three lines?
by steckerbrett 11y ago
for(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++; }