Reputation: 260
When we use /** */ comment style in Java, it have those annotations @param,
or @num1, which makes easier to read the comments, and removes the ambiguities who can appear. For example if you want to make a reference in your comment to num1
, by writing @num1
the color changes and you know that the comment refers at parameter num1
, but if you say num1
, the color of the parameter remains the same and it comes hard to read and may be confused with another variable with the same name. This was just an example.
Java style:
/**
* @param num1
* @param num2
*/
public void sum(int num1, int num2) {
...
}
Upvotes: 2
Views: 1514
Reputation: 48635
It has nothing to do with the language itself but there are documentation generating programs that do understand "Javadoc" style comments.
For example Doxygen.
Upvotes: 6
Reputation: 85452
The C++ standard does not define any comment semantics like Java does with Javadocs.
There are, however, extensions, like doxygen, cldoc or DOC++, which provide similar functionality.
Check if your IDE/text editor supports doxygen syntax highlighting.
Upvotes: 5
Reputation: 310980
C++ doesn't come with a processor for those comments, but they do exist. I was using one 13 years ago. I think it was called ... cppdoc
, but don't quote me.
Upvotes: 1