What is the size of an empty class in C++?

174. What is the size of an empty class in C++?

  1. 1 Byte
  2. 0 Byte
  3. 2 Byte
  4. 4 Byte

Answer: A) 1 Byte

Explanation:

The size of an empty class is 1 byte, every object occupies at least one byte to differentiate memory address space for objects.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.