Question 2.12

My compiler is leaving holes in structures, which is wasting space and preventing ``binary'' I/O to external data files. Can I turn off the padding, or otherwise control the alignment of structure fields?


Your compiler may provide an extension to give you this control (perhaps a #pragma; see question 11.20), but there is no standard method.

See also question 20.5.

References: K&R2 Sec. 6.4 p. 138
H&S Sec. 5.6.4 p. 135


Read sequentially: prev next up top


This page by Steve Summit // Copyright 1995 // mail feedback