The complete Hungarian naming convention

Source: Internet
Author: User

◆ Hungarian naming law

The basic principle is:

Variable name = property + Type + Object Description

(1) attributes:

Global variable: G _

Constant: C _

Class member variable: M _

(2) Type:

Array:

Boolean: B byte:

CHAR: C Byte Count: CB color reference value: CR Coordinate Difference (length): Cx, Cy

DWORD: DW

Floating Point: F function: FN

Handle: H

INTEGER (integer): I

Long Integer (long): l long pointer: lp

Short INTEGER: N near pointer: NP

Pointer: P

String: s string terminated with '/0': SZ

Text Content: TM

Unsigned: u

Word: W

Coordinates: X, Y

(3) Description:

Initialization: init

Temporary Variable: TMP

Target object: DST

Source object: SRC

Window: WND

Below is an example:

Hwnd: h indicates the handle, and WND indicates the window, which together is the "window handle ".

M_bflag: M indicates a member variable, and B indicates a Boolean variable. In combination, it is a member variable of a class. A boolean variable is a state sign ".

1. variable name;
2. Constant naming and macro definition;
3. Resource Name Definition Format;
4. Function naming and namespace, class naming, and interface naming;
5. struct name;
6. Control name;
7. Notes;

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.