【doxygen】Insert code in comments

Doxygen writes comments to the code, but you may need to insert code when writing comments

To insert C code in a Doxygen comment, you can use the @codeand @endcodetags. Put the code to be inserted between this pair of tags and Doxygen will recognize it as a code block. Here is a detailed example:

/**
 * 这是一个示例函数。
 *
 * @code{.c}
 * void exampleFunction() 
 * {
 *    // 在这里插入代码
 * }
 * @endcode
 */
void exampleFunction()
{
    
    
    // 函数的具体实现
}

@code{.c} The language of the code block is specified using the tag C, and @endcodethe code is inserted before the tag. Language tags can be changed as needed to accommodate different programming languages.

おすすめ

転載: blog.csdn.net/tyustli/article/details/131840646