Why Nested Comments Are Not Allowed in C?

Why Nested Comments Are Not Allowed in C?

Because C's comments start and end with specific characters, you cannot put one comment inside another. This is known as nesting. Nested comments can cause errors in your code, so while you're programming, keep track of where comments start and end. ... That's the part the compiler ignores as a comment.

Can comments be nested in C can they be split into multiple lines?

C Language Common pitfalls Multi-line comments cannot be nested.

What is a nested comment?

A nested comment is a comment inside another comment.

Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.