What will the given code print?
#include <iostream>

struct A {
  char a;
  int b;
  char c;
};

int main() {
  std::cout << sizeof(A);
}
Explanation
The size of the int type varies on different platforms. The size of the structure containing data types of various sizes depends on the type of alignment used by the compiler. The type of alignment may depend on the compiler settings.
Read more: Typical alignment of C structs on x86

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести