fork download
  1. #include <stdio.h>
  2.  
  3. #pragma pack(push,1)
  4. typedef struct
  5. {
  6. unsigned char Link :1; //0
  7. unsigned char Speed100 :1; //1
  8. unsigned char Duplex :1; //2
  9. unsigned char Konc :1; //3 Состояние концевика
  10. unsigned char En :1; //4
  11. unsigned char Save :1; //5
  12. }
  13. RegSost_t;
  14.  
  15.  
  16. typedef struct
  17. {
  18. unsigned char Link :1,
  19. Speed100 :1,
  20. Duplex :1,
  21. Konc :1,
  22. En :1,
  23. Save :1;
  24. }
  25. RegSost_t2;
  26. #pragma pack(pop)
  27.  
  28.  
  29.  
  30. int main()
  31. {
  32. int x, x2;
  33.  
  34. x = sizeof(RegSost_t);
  35. x2 = sizeof(RegSost_t2);
  36.  
  37. printf("%d %d", x, x2);
  38.  
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
1   1