What is the practical use of union in C?

You use unions when you want to have different representations of the same data . A good example is when you have a data file with a fixed-size record, but the record may contain different things. For instance, one record may contain 64 characters of text. Another record may contain 16 4-byte integers.

Sizin İçin Seçtik  What are the applications of structures in C?

Leave a Reply

Your email address will not be published. Required fields are marked *