My problem: this structure that was suposed to be 10 bytes big, is in fact 12... At least that's what the printf tells... I really need to resize the structure to exactly 10 bytes. The problem is that in this case 3 + 2 + 1 + 4 = 12.
What's going on here??Code:#include<stdio.h> #include<conio.h> typedef struct{ char tagid [ 3]; //0-2 TAG identifier. It contains of string "ID3" short tagver :16 ; //3-4 TAG version. Can be eg. 03 00 char flags : 8 ; //5 Flags long size :32 ; //6-9 Size of TAG } MP3ID3TAG2; main(){ printf("?: %d\n", sizeof(MP3ID3TAG2)); getch(); }
P.S.: I tried both Visual C++ and GCC, they both do that same thing.