A comment is source text that the C compiler ignores. Use comments to document code and improve its readability and comprehensibility without affecting program execution. section 2.1
C provides two comment forms:
- A block comment begins with /* and ends with */; its contents may span several lines. section 2.1
- A C++-style comment begins with // and continues to the end of its logical line. section 2.1
- Prefer comments that explain purpose, context, or non-obvious implementation details; avoid restating obvious syntax or adding irrelevant decoration. section 10.0
Useful implementation comments
u = nextApprox(u, i, 33, 28); /* Theorem 3 ensures that we may move to the next step. */ ++i; section 10.0
/* The main thing that this program does. */
Inspect a compact block-comment example showing how comments can state a program's main purpose. section 2.1









