Hi All,
I have a code that uses #pragma pack(push,8) but it does not seem to take effect somehow but I can't figure out what's causing this problem.
For example, look at the following code.
#include <windows.h>
#include <stdio.h>
#pragma pack(push, 8)
typedef struct _MY_DATA {
LARGE_INTEGER a;
LARGE_INTEGER b;
ULONG count;
} MY_DATA;
#pragma pack(show)
#pragma pack(pop)
int main()
{
MY_DATA data;
printf("data size:%d\n", sizeof(data));
return 0;
}
This would return "data size:24" but I use the same code in other application that is managed by Visual Studio and there I am getting "data size:20".
So I am assuming it has to do with some settings but could not figure out. I will really appreciate it if anybody could give me some hint. Thanks.