I use a datastructure in my project and in the context of a paricular structure i have a doubt about strucure padding. First Look at the strucure given below. I use Visual S
check out this:
typedef struct myTagDATA_PACK3 { char c; double d; int i; }DATA_PACK3;
it shows 24 bytes. That is: double:8 bytes. int : 4 bytes + (4 bytes padding) = 8 bytes. char: 1 byte + (7 bytes padding) = 8 bytes.
Total:24 bytes.