Hungarian Notation

In general, Hungarian notation names a variable with a lower-case prefix to identify the class or usage of the variable. There is no such thing as standard HN, so the point here is to create a consistent notation system. In this class, we'll use the following standards.

      c: signed character
     uc: unsigned character
      i: integer
     ui: unsigned integer
     si: short integer
     li: long integer
      n: an integer number where the actual size is irrelevant
      f: float
      d: double
      s: string of characters 
     sz: string of characters, terminated by a null character
      b: an integer or character being used as a boolean value
     by: single byte
     ct: an integer being used as a counter or tally
      p: pointer to a structure or general void pointer
    pfs: file stream pointer
    pfn: pointer to a function
     px: pointer to a variable of class x, e.g. pi, pf, pli 


 


 

These prefixes are combined with an identifying name where each significant part begins with a capital letter:


Function names (other than main) also follow this pattern of upper/lower case:

For more information on Hungarian Notation, see Charles Simonyi and Martin Heller, "The
Hungarian Revolution", BYTE, Aug. 1991 (vol. 16, no. 8). 

 Previous