[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Как это понимать



> jek@jekcomp:/tmp$ cat 1.c
> #include <stdio.h>
> int main(void)
> {
>         struct oneRec
>         {
>                 char b1;
>                 char b2;
>                 short id;
>                 char lang;
>                 char b3[2];
>                 char b4[2];
>         } __attribute__((packed));
>
>         printf("sizeof(char)=%d\n",sizeof(char));
>         printf("sizeof(short)=%d\n",sizeof(short));
>         printf("sizeof(struct oneRec)=%d\n",sizeof(struct oneRec));
> }
>
> jek@jekcomp:/tmp$ gcc 1.c
> jek@jekcomp:/tmp$ ./a.out
> sizeof(char)=1
> sizeof(short)=2
> sizeof(struct oneRec)=9
>
> Дальше рассказывать?
Желательно. Честно говоря первый раз такое вижу.
>
> --
> Best regards,
>     Evgeny Khoruzhy jek_hor@tut.by
>
> A: No
> Q: Should I quote below my post?



Reply to: