Is it possible to get the size of the type that a pointer points to in Delphi 7?
问题 I want to get the size of any "record" type in following function. But seems it doesn't work: function GetDataSize(P : Pointer) : Integer; begin Result := SizeOf(P^); // **How to write the code?** end; For example, the size of following record is 8 bytes SampleRecord = record Age1 : Integer; Age2 : Integer; end; But GetDataSize(@a) always returns 1 (a is a variable of SampleRecord type of course). What should I do? I noticed that Delphi has a procedure procedure New(var P: Pointer) which can