-
Hungarian notation
Hungarian notation is an identifier naming convention in computer programming, in which the name of a variable or function indicates its intention or kind, and in some dialects its type.
The original Hungarian Notation is sometimes called Apps Hungarian as it became popular in the Microsoft Apps division in the development of Word, Excel and other apps.
-
History
The original Hungarian notation, which would now be called Apps Hungarian, was invented by Charles Simonyi, a programmer who worked at Xerox PARC circa 1972-1981, and who later became Chief Architect at Microsoft.
PARC(Palo Alto Research Center, formerly Xerox PARC) is a research and development company in Palo Alto, Califonia. Formed in 1969.
-
Coding Style Concentions From Microsoft
From Microsoft, Hungarian Notation has become a common coding practice in Win32 programming. They include variable prefix notations that give to variable names a suggestion of the type of the variable.
The following table lists common prefixes:
Prefix Description a Array b BOOL (int) c Char cb Count of bytes cr Color reference value cx Count of x (short) dw DWORD (unsigned long) f Flags (usually multiple bit values) fn Function g_ Global h Handle i Integer l Long lp Long pointer m_ Data member of a class n Short int p Pointer s String sz Zero terminated String tm Text metric u Unsigned int ul Unsigned long (ULONG) w WORD (unsigned short) x,y x, y coordinates (short) Much more information could be found here.
-
Refrecences
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交