Question from the Language C - Fundamentals test

What is the size of a long long in C++?

Easy

In C, knowing that on the machine where the following code is executed a long weighs 8 bytes, a char 1 byte and a short 2 bytes, give the size in bytes of the following structure (1 correct answer only) :

struct t {
 long z;
 union U {
    long a;
    char b;
    long c;
 }u;
};
Author: Vincent CotroStatus: PublishedQuestion passed 713 times
Edit
4
Community Evaluations
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
Other
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.