What is the best use case of union in C? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the best use case of union in C?

Although this topic has been fairly discussed here and many other forums, however I couldn't find the best use case of this feature. Yes the difference between struct and union is in their allocation of memory but why should we prefer one over the other?

3rd Jun 2019, 2:23 PM
Ali Anwar
Ali Anwar - avatar
1 Answer