variablesdelphimemoryfreepascalturbo-pascal

How to calculate the amount of memory occupied by the variable in Pascal?


I need to calculate the amount of memory that any variable takes. Thanks for any input.

Edit: I didn’t notice that I need to calculate it manually (by hand). Thanks.


Solution

  • SizeOf(variable)
    

    of course that only goes for the variable not to any additional memory the variable might point to, or any alignment if it is part of a structured type.