class Arithmetic
{
// This method adds two numbers, and returns the result.
// dbNum1 is the first number to add, and dbNum2 is second.
// The returning value is dbNum1+dbNum2.
static double AddTwoNumbers(double dbNum1, double dbNum2);
}
对于这个示例代码,有没有更好的方法来编写注释行?
对于 C++ 来说,没有像 javadoc 这样的标准,但某些文档工具很流行并且常用。在我的脑海里,我可以提到doxygen http://doxygen.org.
Doxygen 还支持熟悉的 javadoc 风格,即:
/**
This method adds two numbers, and returns the result.
@param dbNum1 is the first number to add
@param dbNum2 is second.
@return The returning value is dbNum1+dbNum2.
*/
static double AddTwoNumbers(double dbNum1, double dbNum2);