You copied the Doc URL to your clipboard.

Compiler storage of data objects by natural byte alignment

C data types are aligned on specific byte boundaries, depending on their type.

By default, the compiler stores data objects by byte alignment as shown in the following table.


Table 1. Compiler storage of data objects by byte alignment
Type Bytes Alignment
char, bool, _Bool 1 Located at any byte address.
short, wchar_t 2 Located at any address that is evenly divisible by 2.

float, int, long, pointer

4 Located at an address that is evenly divisible by 4.

long long, double, long double

8 Located at an address that is evenly divisible by 8.