## Unions

Unions are very similar to structs, but the data shares the same memory spaces, so they cannot be used at the same time.

Unions are similar to structures but only one member within the union can be used at a time, due to it having a shared memory size for all members.

union identifier {
char desc[50] ;     float price ;     int devs ;     } ;

Unions are used when just one condition will be applied and only one variable is required.

### Unions

#include <iostream>using namespace std ; union opSysName {    char desc[50];    float price;    int devs;} ; int main() {     union
opSysName linux = {"fun, free and better!"} ;    cout << "The best OS might just possibly be " << linux.desc ;     /*set price - remembering that a union can only hold one variable at a time*/