Int (4 bytes)
char (1 byte)
Pero la computadora tiene preferencia de siempre terminar alinear a cada 4 bytes (Esto cambia mucho) dependiendo del sistema y compilador que uses. Ejemplo.
Código
Total 16 Bytes Y para el otro ejemplo
struct a { int xi; //4 Bytes toma 4 bytes char n; //1 Bytes pero lo Alinea a 4 bytes int y; //4 Bytes toma 4 bytes char m; //1 Bytes pero lo Alinea a 4 bytes }
Código
Total 12 bytes
struct b { int xi; //4 Bytes toma 4 bytes int y; //4 Bytes toma 4 bytes char n; //1 Bytes char m; //1 Bytes pero alinea los 2 ultimos a 4 bytes }


