C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Packing Structure Members (/Zp)
                                             Up Contents Index Back
─────C/C++ Compiler─────────────────────────────────────────────────────────
 
     Syntax:  /Zp[number]
 
     This option sets the packing of data in structures and unions of a
     module to the same boundary. The <number> field represents 1-, 2-,
     or 4-byte boundaries where each structure member is stored after
     the first one. If you use /Zp without an argument, structure
     members are packed on 1-byte boundaries──that is, they are stored
     contiguously. No space is allowed between /Zp and <number>.
 
     On some processors, /Zp can cause slower program execution. Some
     time is required to unpack structure members when accessed. On an
     8086 processor, for example, this option can reduce efficiency if
     members with int or long type fall on odd-byte boundaries.
 
     Use the pack pragma when you want to specify packing other than
     the packing specified on the command line for particular
     structures.
 
     See: pack pragma
                                    -♦-