简体   繁体   中英

C/C++: What does the comment “/*< */” stand for?

I've got a rather general question: I've recently seen many #defines in C/C++ code that were commented with "/*< ... */", for example:

#define ARRSIZE(x)          (sizeof(x)/sizeof(x[0]))        /*< macro to determine the size of an array */

I personally only saw that in comments for defines and a search in Google didn't answer my question either. Does that have any meaning? Is that just common practice or does it come from Doxygen? Or is it any other reason?

Generally, < is Doxygen's syntax for documentations that come after the item that they document.

An example from the "Putting documentation after members" section of the Doxygen documentation:

int var; /**< Detailed description after the member */

What's curious about the example you gave, though, is that it uses a normal comment block ( /* ) as opposed to a documentation block (eg, /** ). I suspect this is an oversight of the author of this specific example. Alternatively, it might be that the author extends this convention from documentation blocks to all comments similar in nature.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM