fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3. #include <stdint.h>
  4. #include <stdio.h>
  5.  
  6. typedef struct structTag {
  7. union {
  8. struct {
  9. uint32_t messageID : 26; /* 26bit message id, 67108864 ids */
  10. uint8_t priority : 3; /* priority: MUST BE 0 */
  11. } __attribute__ ((packed));
  12. uint32_t rawID : 29;
  13. uint8_t canFlags : 3;
  14. } __attribute__ ((packed));
  15. } __attribute__ ((packed)) idSpecial;
  16.  
  17. int main() {
  18. printf("size: %d", sizeof(idSpecial));
  19. return 0;
  20. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
size: 4