zig: Comments
csm
1 min read
Zig has only single-line comments, but with three variants:
- Normal comments:
// This is a comment!
std.debug.print("hello world!",.{}); // This is also a comment!
- doc-comments:
/// This function prints 'hello!'
- top-level doc comments:
//! This is a top level doc comment.
NOTE:
Normal comments are the ones we beginners can use in any way:
to write comments
to comment a line of code
But, the other two(doc comments) are special ones for generating docs for packages.
So, don't mess with them for now!
0
Subscribe to my newsletter
Read articles from csm directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by