# get_struct_size

Definition: | include cffi.e integer size = get_struct_size(integer id)
Description: | Get the total size of a structure previously defined by define_struct().
pwa/p2js: | Not supported.
Comments: | May be required when allocating arrays of structures or something more complicated. For example a bitmap creation routine might use this routine to get the size of a BITMAPINFOHEADER, and possibly the size of a palette entry, multiply the latter by however many palette entries are needed, and add on the size needed for all the pixels incluing any line padding, before allocating that memory manually.
Example: |
    include cffi.e
    integer idMBP = define_struct(...)
    integer size = get_struct_field(idMBP)
See Also: | define_struct, set_struct_field, get_struct_field, allocate_struct, peek, poke