function AlignOf (var x): Integer;
Returns the alignment of a type or variable in bytes.
AlignOf is a GNU Pascal extension.
program AlignOfDemo; var a: Integer; b: array [1 .. 8] of Char; begin WriteLn (AlignOf (a)); { Alignment of `Integer', e.g. 4 bytes. } WriteLn (AlignOf (Integer)); { The same. } WriteLn (AlignOf (b)); { Alignment of `Char'; usually 1 byte. } end.
Although the array is bigger than a single char, it is accessed char by char, so there usually is no need to align it on a 4 byte boundary or such. (This may be false on some platforms.)