What is the sizeof (A) on the 32-bit platform, where A has the following definition::

class A
{
   int a;
   char ch;
   double d;
   virtual void f() = 0;
};
Explanation
The compiler will align to the largest size of double. The virtual​ function takes an additional 4 bytes, and also aligned to 8 bytes.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты