Linksx Linksx - 2 years ago 122
C++ Question

Does C++ (Visual Studio) have Java style comments?

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) {
...
}

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download