Guaranteed ANSI C struct sizes -


i want read, edit, , write bmp files without external libraries, using standard c.

if understand correctly, important bytes aligned match bmp file format.

however, think have read somewhere on internet compiler allowed pad struct bytes cannot sure how many bytes struct takes up, or how members aligned within struct.

how solve issue using standard c? there syntax asking compiler make sure struct looks way specify it?

how solve issue using standard c? there syntax asking compiler make sure struct looks way specify it?

the c standard not provide standard way control struct layout. so, if dead set on using specified standard, cannot use structs process windows bitmap files.

to solve using standard c need write/read byte arrays , serialize/deserialize them yourself.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -