c / beginner
Snippet
Code Documentation with Comments
Comments are non-executable parts of the code used to explain logic to other developers. C supports both single-line (//) and multi-line (/* */) comments.
snippet.c
1
2
3
4
5
6
// This is a single-line comment/* This is a multi-linecomment used forlonger descriptions */int x = 5;
Breakdown
1
// This is a single-line comment
A comment that ends at the end of the line.
2
/* ... */
A block comment that can span multiple lines.