C + + comments and Doxygen comments

Source: Internet
Author: User
Tags doxygen

C + + annotations

There are only two types of comments in C + +:

    1. Single-line comment, beginning with "//";
    2. The paragraph comment begins with "/*" and ends with "*/".
int // value is an integer variable, which is a single-line comment /*   test is a class for testing this is a  line in a comment  this is another line in a comment */class  Test {};
Doxygen Note: Keep in mind that the following 3 grammar rules are enough

Doxygen comments can be categorized as follows, as described above in the C + + comments:

    1. Front-line comment, starting with "//";
    2. A post-line comment, beginning with "///<", immediately following the code;
    3. The paragraph comment begins with "/**" and ends with "*/".

Doxygen comments are not just for people to see, when generating a document, the program needs to identify the relative position of the annotation and code according to the agreed syntax, so the Doxygen's single-line comment can be divided into two predecessors:

/// value0 is an integer variable, and the comment precedes the code int Value0; int /// < value1 is an integer variable, and the comment is behind the code

Paragraph comments can also be divided into pre-and post-two, but the post-paragraph comment is not very meaningful, I oppose the students write the post-paragraph comment:

/* *test is a test class this is a line in a comment statement this is another line in a comment statement */ class Test {};
Examples\afterdoc.h

Doxygen installation folder under the Examples\afterdoc.h, the contents are as follows:

/*! A Test Class*/classtest{ Public:    /** An enum type.      * The documentation block cannot is put after the enum! */    enumEnumtype {intEVal1,/**< enum value 1*/      intEVal2/**< Enum value 2*/    }; voidMember ();//!< a member function.      protected:    intValue/*!< an integer value*/};

Using the above 3 grammar rules to readjust, is not circumnavigated enlightened?

/** A Test class*/classtest{ Public:  /** An enum type.  The documentation block cannot is put after the enum! */  enumEnumtype {intEVal1,///< enum value 1int EVal2///< enum value 2  };   voidMember ();///< a member function.   protected:  intValue///< an integer value};

Series Article index: http://www.cnblogs.com/duxiuxing/p/4301031.html

C + + comments and Doxygen comments

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.