Ah! What you’re seeing isn’t actually C++ behavior—it’s coming from whatever editor or IDE you’re using. Let me break it down carefully:
C++ block comments:
Correct: /* this is a block comment */
Starts with /* and ends with */. Everything in between is ignored by the compiler.
Your typo: /**
In plain C++, this is still just a block comment, because the compiler only cares that it starts with /* and ends with */. The extra * doesn’t change compilation.
So for the compiler, /** something */ is perfectly valid.
Why your editor shows bold:
Many editors (VS Code, JetBrains IDEs, etc.) use syntax highlighting rules that interpret /** as the start of a documentation comment (like Doxygen in C++).
Documentation comments are meant to describe functions, classes, or variables, and IDEs often render them in bold, italic, or a different color to distinguish them from regular comments.
Example:
/**
* This is a doc comment
*/
void foo() {}
Here, /** triggers the editor to treat it as a doc comment.
✅ In short: Your code is fine for compilation; the bold just means your editor thinks it’s a doc comment (Doxygen-style).
If you want, I can also show a quick table of all C++ comment types and how editors usually highlight them so you can avoid these visual surprises. Do you want me to do that?