I`m working on an LZW compression app in C++. Since there are no data types that can store 12 bit numbers for representing table elements up to 4095 I thought that I can store 2 of those nrs as 3 bytes in a file and then read them as a struct with 2 unsigned short members. Is there a way to do that or I should just use unsigned short? This is what I have tried but it stores 4 bytes as there are 2 unsigned short members.

```
#define BITS 12

struct LZWStruct {
    unsigned short code1 : BITS;
    unsigned short code2 : BITS;
};

int main() {
    LZWStruct test;
    test.code1 = 144;
    test.code2 = 233;

    FILE* f = fopen("binary.bin", "wb");
    fwrite(&test, sizeof(test), 1, f);
    fclose(f);
}

```