Author: Unknown
Subject: Alignment on Structs
Date: Thursday, 09 Apr 2020, 01:23:10
Is memory for structs automatically set to multiples of 8 bytes when storing them dynamically? Currently, I have a struct which contains a pointer (8 bytes) to another struct and an int (4 bytes), and when I dynamically allocate memory for this struct it allocates 16 bytes. My computer and the zoo are both 32-bit so I thought that they have processing sizes of 4 bytes, so I am not entirely sure.PREV INDEX NEXT