Windows client/C + + programming Specification "Recommendations"--style

Source: Internet
Author: User

9 Style 9.1 Preferential use of Hungarian nomenclature level: "Recommended"
Description: This method is designed by the Microsoft Master Designer. Programming on Windows best complies with this standard. Detailed introduction See: http://zh.wikipedia.org/wiki/%E5%8C%88%E7%89%99%E5%88%A9%E5%91%BD%E5%90%8D%E6%B3%95

9.2 variable names are combined using the Hungarian nomenclature and Hump nomenclature classes:"Recommended"
Description: for example int nmaxcount = 1; the variable prefix n denotes int type variable, maxcount is ideographic, it is using the Hump naming method (capitalized).

9.3 The default keyword is followed by parentheses to separate the level with a space: "Recommended"
Note: A space is added between the If/switch/while/for/catch and the parentheses behind it. This allows you to quickly distinguish between an API or a language keyword for the operation of parentheses.

9.4 Global variables use g as the prefix level: "Recommended"
Description: Used to clearly differentiate the variable as a global variable.

9.5 Global static variables use S_ as the prefix level: "Recommended"
Description: Used to clearly differentiate the variable as a global variable.

9.6 Class static members use the _S_ prefix level: "Recommended"
Description: Used to clearly distinguish whether the variable is a global variable or a class static member variable.

9.7 Global static variables are named as long as possible and have a meaningful rating: "Recommended"
Note: This ensures that the same name does not appear.

9.8 Enumeration type members, using the all-uppercase serpentine nomenclature level: "Recommended"

Note: All letters are capitalized, and the words are separated by underscores. It is best to use e_ as a prefix


(reprint please indicate CSDN blog for breaksoftware)

Windows client/C + + programming Specification "Recommendations"--style

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.