Question regarding memory allocation of variables in a structure (In C) <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member">Why isn&#39;t sizeof for a struct equal to the sum of sizeof of each member?</a> </p> </blockquote> <pre><code>#include &lt;stdio.h&gt; int main(){ struct word1{ char a; int b; char c; }; struct word2{ char a; char b; int c; }; printf("%d\t%d\n", sizeof(int), sizeof(char)); //Output : 4 1 printf("%d\t%d\n", sizeof(struct word1), sizeof(struct word2)); //Output: 12 8 return 0; } </code></pre> <p>The code is available at <a href="http://www.ideone.com/13Wlr" rel="nofollow">IDEONE</a>.</p> <p>Why is the size of struct 1 (word1) greater than the size of struct 2 (word2)? </p> <p>Is this a compiler problem?</p>