### Data Mapping

Each data format supported by IBM C and C++ Compilers is mapped into storage with a specific alignment.

Alignment refers to the positioning of variables on byte boundaries. Alignment within a structure can be changed via #pragma pack or via the /Sp compiler option.

For automatic variables, consider the following information:

- Automatic variables have the same mapping as other variables.
- When optimization is turned on, automatic variables are ordered to minimize padding.
- Automatic variables are always mapped on the stack instead of a data segment. Because memory on the stack is constantly reallocated on the stack, automatic variables are not guaranteed to be retained after the return of the function that used them.

Mapping of Fundamental Data Types
Mapping of Compound Data Types
Format of Single-Byte Character Data
Format of Double-Byte Character Data
Format of Two-Byte Integer Data
Format of Four-Byte Integer Data
Format of Eight-Byte Integer Data
Format of Ten-Byte Floating Point Data in Sixteen-Byte Fields
Format of Null-Terminated Character Strings
Format of Fixed-Length Arrays of Fundamental Data Types
Format of Aligned Structures
Format of Unaligned or Packed Structures
Format of Arrays of Structures
Format of Structures Containing Bit Fields (OS/2)
Format of Structures Containing Bit Fields (Windows)