Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Hungarian notation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples== *<code>bBusy</code> : [[Boolean data type|Boolean]] *<code>chInitial</code> : [[character (computing)|char]] *<code>cApples</code> : count of items *<code>dwLightYears</code> : double [[Word (data type)|word]] (Systems) *<code>fBusy</code> : [[Boolean data type|flag]] (or [[Floating-point|float]]) *<code>nSize</code> : [[Integer (computer science)|integer]] (Systems) or count (Apps) *<code>iSize</code> : [[Integer (computer science)|integer]] (Systems) or index (Apps) *<code>fpPrice</code> : [[floating-point]] *<code>decPrice</code> : decimal *<code>db[[Pi]]</code> : [[double precision|double]] (Systems) *<code>p[[Foo]]</code> : [[pointer (computer programming)|pointer]] *<code>rgStudents</code> : array, or range *<code>szLastName</code> : zero-terminated string *<code>u16Identifier</code> : unsigned 16-bit [[Integer (computer science)|integer]] (Systems) *<code>u32Identifier</code> : unsigned 32-bit [[Integer (computer science)|integer]] (Systems) *<code>stTime</code> : clock time structure *<code>fnFunction</code> : function name The mnemonics for pointers and [[Array data structure|arrays]], which are not actual data types, are usually followed by the type of the data element itself: *<code>pszOwner</code> : pointer to zero-terminated string *<code>rgfpBalances</code> : array of [[floating-point]] values *<code>aulColors</code> : array of unsigned long (Systems) While Hungarian notation can be applied to any programming language and environment, it was widely adopted by [[Microsoft]] for use with the C language, in particular for [[Microsoft Windows]], and its use remains largely confined to that area. In particular, use of Hungarian notation was widely [[Technology evangelist|evangelized]] by [[Charles Petzold]]'s ''"Programming Windows"'', the original (and for many readers, the definitive) book on [[Windows API]] programming. Thus, many commonly seen constructs of Hungarian notation are specific to Windows: * For programmers who learned Windows programming in C, probably the most memorable examples are the <code>wParam</code> (word-size parameter) and <code>lParam</code> (long-integer parameter) for the [[WindowProc]]() function. * <code>hwndFoo</code> : handle to a window * <code>lpszBar</code> : long pointer to a zero-terminated string The notation is sometimes extended in [[C++]] to include the [[scope (programming)|scope]] of a variable, optionally separated by an underscore.<ref>{{cite web|title=Mozilla Coding Style|url=https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Prefixes|website=Developer.mozilla.org|access-date=17 March 2015|archive-date=2 December 2019|archive-url=https://web.archive.org/web/20191202222313/https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Prefixes|url-status=dead}}</ref><ref>{{cite web|title=Webkit Coding Style Guidelines|url=http://www.webkit.org/coding/coding-style.html#names-data-members|website=Webkit.org|access-date=17 March 2015}}</ref> This extension is often also used without the Hungarian type-specification: * <code>g_nWheels</code> : member of a global namespace, integer * <code>m_nWheels</code> : member of a structure/class, integer * <code>m_wheels</code>, <code>_wheels</code> : member of a structure/class * <code>s_wheels</code> : static member of a class * <code>c_wheels</code> : static member of a function
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)