C TutorialLesson 6Free preview
C Comments
This lesson is part of C · All levels
Summary
Commentary is a note in code that is ignored by the compiler, used to explain the content of the program for easy reading and maintenance. C supports two comment styles: one line with the // mark and multi-line comments that open with /* and close with the */ end. Multi-line comments are also useful for temporarily disabling some code during debugging. Although compilers ignore it, well-written comments are a great help to teamwork.
Key points
- One line comment is written with the // mark at the beginning of the comment
- Multi-line comments wrapped up at the beginning and at the end
- Comments are not executed and do not affect the outcome of the program
- Nested comments /* */ are not supported, so be careful putting */
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.