How do I write in-code comments and documentation in a proper way? Is there any standard for this?

Posted by hkBattousai on Stack Overflow See other posts from Stack Overflow or by hkBattousai
Published on 2011-01-04T11:41:20Z Indexed on 2011/01/04 11:53 UTC
Read the original article Hit count: 226

Filed under:
|
|
|
|

I want to add documentation in my code by means of comment lines.
Is there any standard format for this?

For example, consider the code below:

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);
}

For this example code, is there any better way of writing the comment lines?

© Stack Overflow or respective owner

Related posts about c++

Related posts about documentation