简单程序~关于内存对齐的问题~请大神解答!
#include <stdio.h>#include <malloc.h>
#pragma pack(8)
int main()
{
char s1[] = {'H', 'e', 'l', 'l', 'o'};
int i = 0;
char s2[] = {'W', 'o', 'r', 'l', 'd'};
char* p0 = s1;
char* p1 = &s1[3];
char* p2 = s2;
int* p = &i;
printf("%d\n", p0 - p2);
return 0;
}
//结果为何是 16 、、、 能不能告诉我是肿么计算的~