Q. What will sizeof return for the following structure?

Code:
struct sample {
    char c;
    int i;
};
  • (A) 5
  • (B) 8
  • (C) 6
  • (D) 4
πŸ’¬ Discuss
βœ… Correct Answer: (B) 8
Explanation: Padding for alignment makes the size 8 bytes on most systems.
Explanation by: Mr. Dubey
Padding for alignment makes the size 8 bytes on most systems.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
71
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
99%
Success Rate