Search code examples
c++variablestypessize

Is there a type for 16 size data?


I heard that in 32bit computer(1990~2000?) had to use a 8 size data like below; (that I heard of... there was no 8 size type, then... ) they used like this;

// 8 size 
typedef union _LARGE_INTEGER {
    struct {
        DWORD LowPart;
        LONG HighPart;
    } DUMMYSTRUCTNAME;
    struct {
        DWORD LowPart;
        LONG HighPart;
    } u;
    LONGLONG QuadPart; // I'm not sure of this part;
} LARGE_INTEGER;

So I want to try to make a 16 size type for my own it is ok to use it like this??

// 16 size 
typedef union INTERGER128 {
    struct {
        LONGLONG LowPart;
        LONGLONG HighPart;
    } u;
} _INTERGER128;

Solution

  • I used another way to may a 16 size variable

    __declspec(align(16)) struct aa {
        long long a;
        long long b;
        char c;
    }
    

    this way you can make a 16 size padding in structs