Actions

EmSys

CCoding Style - Use Idioms for consistency2

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Use Idioms for consistency ...

Indentation should be idiomatic too.

for(
    ap = arr;
    ap < arr + 128;
    *ap++ = 0 ; )
{
    . . .
}

This unusual vertical layout detracts from readability; it looks like three statements, not a loop:

for( ap = arr; ap < arr + 128; ap++ )
    *ap = 0;