Q. Which of these uses the most memory?

Code:
union data {
    int i;
    float f;
    char str[20];
};
  • (A) i
  • (B) f
  • (C) str
  • (D) Depends on the usage
πŸ’¬ Discuss
βœ… Correct Answer: (C) str
Explanation: Unions use the memory of the largest member. str[20] uses 20 bytes.
Explanation by: Mr. Dubey
Unions use the memory of the largest member. str[20] uses 20 bytes.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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