Ingvar Marny wrote:
program test;
type t1 = packed record item1 : byte; item2: byte; item3: byte; end; t2 = packed array [0..0] of t1;
begin writeln ('SizeOf (t1): ', SizeOf (t1)); writeln ('SizeOf (t2): ', SizeOf (t2)); readln; end.
Output of program:
SizeOf (t1): 3 SizeOf (t2): 4
Could anybody tell me - why?
Packed arrays are currently accessed in half-word entities (i.e., 16 bits on most systems). This might seem unlogical, but the packing is only done within the array, not outside.
I might change it sometime because it also causes other (small) problems, but it's not trivial to do ...
Frank