Possible Duplicate:
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
Here is the code:
#include <stdio.h>
struct small{
int a;
int b;
char c;
};
void main(){
printf("The size of int is: %d\n",(int)sizeof(int));
printf("The size of char is: %d\n",(int)sizeof(char));
printf("The size of small is: %d\n",(int)sizeof(struct small));
}
Here is the output:
The size of int is: 4
The size of char is: 1
The size of small is: 12
I expect the size of small to be 9,but it turns out to be 12