Why union is better than structure in C?

Advantages of Union Union takes less memory space as compared to the structure . Only the largest size data member can be directly accessed while using a union. It is used when you want to use less (same) memory for different data members.

Sizin İçin Seçtik  20 TL kaç yılında çıktı?

Leave a Reply

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

Why union is better than structure in C?

Advantages of Union Union takes less memory space as compared to the structure . Only the largest size data member can be directly accessed while using a union. It is used when you want to use less (same) memory for different data members.

Sizin İçin Seçtik  What is typedef union in C++?

Leave a Reply

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