| title | -Zp (Struct Member Alignment) | Microsoft Docs | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||
| ms.reviewer | ||||||||||||||
| ms.suite | ||||||||||||||
| ms.technology |
|
|||||||||||||
| ms.tgt_pltfrm | ||||||||||||||
| ms.topic | article | |||||||||||||
| f1_keywords |
|
|||||||||||||
| dev_langs |
|
|||||||||||||
| helpviewer_keywords |
|
|||||||||||||
| ms.assetid | 5242f656-ed9b-48a3-bc73-cfcf3ed2520f | |||||||||||||
| caps.latest.revision | 11 | |||||||||||||
| author | corob-msft | |||||||||||||
| ms.author | corob | |||||||||||||
| manager | ghogen | |||||||||||||
| translation.priority.ht |
|
Controls how the members of a structure are packed into memory and specifies the same packing for all structures in a module.
/Zp[1|2|4|8|16]
When you specify this option, each structure member after the first is stored on either the size of the member type or n-byte boundaries (where n is 1, 2, 4, 8, or 16), whichever is smaller.
The available values are described in the following table.
1
Packs structures on 1-byte boundaries. Same as /Zp.
2
Packs structures on 2-byte boundaries.
4
Packs structures on 4-byte boundaries.
8
Packs structures on 8-byte boundaries (default).
16
Packs structures on 16-byte boundaries.
You should not use this option unless you have specific alignment requirements.
You can also use pack to control structure packing. For more information about alignment, see:
-
Examples of Structure Alignment (x64 specific)
-
Open the project's Property Pages dialog box. For details, see Working with Project Properties.
-
Click the C/C++ folder.
-
Click the Code Generation property page.
-
Modify the Struct Member Alignment property.
- See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.StructMemberAlignment%2A.