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

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

int main() {
  std::cout << sizeof(A);
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
Обратная Связь
Зарегистрируйся сейчас
или Подпишись на будущие тесты