A

Admin • 833K Points
Coach

Q. What will sizeof return for the following structure?

Code:
struct sample {
char c;
int i;
};
  • (A) 5
  • (B) 8
  • (C) 6
  • (D) 4
  • Correct Answer - Option(B)
  • Views: 26
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

Padding for alignment makes the size 8 bytes on most systems.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.