Why do we use union in C++?

Union is a user-defined datatype. All the members of union share same memory location. Size of union is decided by the size of largest member of union. If you want to use same memory location for two or more members , union is the best for that.

Sizin İçin Seçtik  What is Sandbox stock price?

Leave a Reply

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