Introduction to Computer Systems Unions

Unions

Struct:


struct S1
{
    char c;
    int i[2];
    double v;
} *sp;

Union:


union U1
{
    char c;
    int i[2];
    double v;
} *up;