comment est la memoire avec typedef union
bonjour,
je veux être sur d'avoir bien compris l'utilisation de typedef union:
si je déclare dans un .h:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| typedef struct
{
uint32 value;
uint32 RESERVE_2;
} CONF_mono;
typedef struct
{
uint32 mode_IR2;
uint32 mode_IR3;
} CONF_bi;
typedef union
{
CONF_mono mono;
CONF_bi bi;
} CONF_type_EBF; |
D'après la définition de struct union, ma structure CONF_type_EBF vaut soit mono, soit bi
Comment ça fonctionne en mémoire, combien de "cases" uint 32 sont allouées ? 2 ou 4