A-97
Appendices
NJ-series CPU Unit Software User’s Manual (W501)
A-7 Variable Memory Allocation Methods
App
A-7-1 Variable Memory Allocation Rules
For a union variable, the members overlap in the same memory locations. The alignment of a union is
largest alignment of all of the members. The amount of memory that is allocated is the largest amount
of memory that is allocated for any of the members.
Example: The alignments and the amounts of memory that are allocated for the four variable declara-
tions given in the following figure are given in the following table.
Unions
Variable Alignment [bytes] Amount of memory that is allocated [bytes]
A4 4
B4 4
C4 8
D4 8