Sounds like your platform uses 32 bit ints and 32 bit pointers.
That means the layout of your object is: 4 bytes a, 4 bytes b, 1 byte c, 3 bytes padding.
Without trailing padding, if you would make an array of two such objects, the second object's member a would not be at an address that's divisible by four, violating int's alignment requirement.
the answer should be 16,shouldn't it?
maybe the answer is also depend on the complier,the codeblocks say it is 24
it runs on the codepad.org(the online complier),the answer is 16.
I think that the codeblocks has integers of size 8. As for codepad.org then it is possible that some compiler option is used that sets the default alignment to the paragraph boundary.