Q. Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory requirement for variable t, ignoring alignment considerations, is

Code:
struct { 
    short s[5];
    union { 
         float y; 
         long z; 
    }u; 
} t;
  • (A) 22 bytes
  • (B) 14 bytes
  • (C) 18 bytes
  • (D) 10 bytes
πŸ’¬ Discuss
βœ… Correct Answer: (C) 18 bytes

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
294
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
86%
Success Rate