Created
March 17, 2015 09:19
-
-
Save good5dog5/6638ebf4be62bf094912 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
struct ABC { | |
int index; | |
char name[6]; | |
int score; | |
} __attribute__((packed));; | |
struct DEF { | |
int att; | |
char name[3]; | |
} __attribute__((packed));; | |
int main(int argc, char ** argv) | |
{ | |
printf("sizeof(ABC) = %d\n", sizeof(struct ABC)); | |
printf("sizeof(DEF) = %d\n", sizeof(struct DEF)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment