Question du test C - Les bases

Quelle est la taille d'un long long en C++?

Facile

En C, sachant que sur la machine ou exécute le code suivant un long pèse 8 octets, un char 1 octet et un short 2 octets, donnez la taille en octet de la structure suivante (1 seule bonne réponse) :

struct t {
 long z;
 union U {
    long a;
    char b;
    long c;
 }u;
};
Auteur: Vincent CotroStatut : PubliéeQuestion passée 648 fois
Modifier
2
Évaluations de la communauté
developer avatar
Lancelot
20/12/2023
Actually the alignement in memory isn't as precise as the anwsers, it depends of the memory layout and compiler. The compiler may add padding for alignment requirements.
developer avatar
Autre
Nicolas
03/02/2024
I cannot choose an answer, when I click nothing happens
developer avatar
Auteur anonyme
06/02/2024
Hello Nicolas, I'm sorry for that. Did you experienced the same problem on another question ?
developer avatar
Nicolas
06/02/2024
Yes, it happened for every question. I found out that it did select my answer but my answer wasn't checked so I couldn't know what was selected. Everything else was working fine.