为什么sizeof结构错了?

时间:2015-04-02 14:22:25

标签: c sizeof

typedef struct{
    int tournamentNo;
    char tournamentName[61];
    char toutnamentDate[15];
    char tournamentCity[21];
}Tournament;

printf(":%d",sizeof(锦标赛));

结果:1​​04

实际:61 + 15 + 21 + 4 = 101

typedef struct{
    int tournamentNo;
    char tournamentName[20];
    char toutnamentDate[15];
    char tournamentCity[21];
}Tournament;

printf(":%d",sizeof(锦标赛));

结果:60

实际:20 + 15 +21 +4 = 60

为什么不同呢?

0 个答案:

没有答案
相关问题