Hungarian notation
for C/C++/Java variable names
|
syntax |
[scope]_<types><NameString>
example: g_pszVarName
|
key |
|
|
|
| notation | description |
| g_ | global |
| m_ | member (of a class, usually) |
| use neither for local variables | |
|
| |
| notation | description |
| a | array |
| b | BOOL or boolean |
| ch | char |
| dw | dword |
| f | float |
| fn | Function. |
| h | HANDLE (WinAPI) |
| hwnd | HWND (WinAPI) |
| i | int |
| l | long |
| n | also int |
| p | Pointer. |
| pv | Void pointer. |
| pt | POINT struct (WinAPI) |
| r or rc | RECT struct (WinAPI) |
| s | struct |
| sz | Null-terminated string (stands for string, zero terminated). |
| w | word |
|
Examples |
|
Custom types |
This works well for all the primitive types, but what about when you make your own typedef struct or class?
In cases like this, I just wing it and do whatever seems logical at the moment:
For instance, if we have a class ListIterator, an instance of that class could be ListIterator *pliIterator (local pointer to a ListIterator object named Iterator).
|
  |
Note: I built this page off the top of my head based on what I use all
the time. Other people go by different hungarian notation rules.
If something is blatantly wrong,
send me an email and I'll fix it.
|
|
This site was last built on 8/10/98; 5:39:28 PM with 5.0.2b20. Internet service provided by JavaNet. Mail to: dmorelli@ct1.nai.net. This site is currently being built on Windows 95 |