Skip to content
John P. Hartmann edited this page Dec 12, 2013 · 1 revision

See paradigma, in this case the existing body of code.
Not all code adheres to these suggestions. Malformed correct code is infinitely better than well formed incorrect code.

Indentation

Blocks should be indented by four blanks.
Avoid tab characters.

Braces are put on separate lines aligned with the keyword that starts the block, for example:

    if(!pCTCBLK)
    {
        strlcpy(pBuffer,"*Uninitialized",iBufLen);
    }

Comments

Some favour C++ line comments though these are not strictly C.