两个不一样的结构为什么会一样大?
下面的两个结构SS和TT不一样,但sizeof却一样大,都是56,为什么?
#include <stdio.h>
#include <windows.h>
#include <tchar.h>
typedef struct _VM_COUNTERS {
SIZE_T PeakVirtualSize;
SIZE_T VirtualSize;
ULONG PageFaultCount;
SIZE_T PeakWorkingSetSize;
SIZE_T WorkingSetSize;
SIZE_T QuotaPeakPagedPoolUsage;
SIZE_T QuotaPagedPoolUsage;
SIZE_T QuotaPeakNonPagedPoolUsage;
SIZE_T QuotaNonPagedPoolUsage;
SIZE_T PagefileUsage;
SIZE_T PeakPagefileUsage;
} VM_COUNTERS;
typedef struct _TT
{
LARGE_INTEGER CreateTime;
VM_COUNTERS VmCounters;
} TT;
typedef struct _SS
{
LARGE_INTEGER CreateTime;
VM_COUNTERS VmCounters;
ULONG PrivateUsage;
} SS;
int _tmain(int argc, _TCHAR* argv[])
{
_tprintf(TEXT("%d %d\r\n"), sizeof(SS), sizeof(TT));
return 0;
}
// Output:
// 56 56
// 请按任意键继续. . .
...全文


