Answer
When you are using C, structure padding is used to pad the data in such a way that it can be sent to external devices. Sometimes, the data is padded in such a way that it can be used on little endian vs big endian processors
======= Adding to above:
Padding is done to fast access of data from memory. Structure members are alined to based on the memory pointer size, which is normally 32bit in Win32 systems. So a character variable defined may take 4 bytes. Hence the size of sturcute is not really the sum of size individual memmbers.
First answer by ShockRide. Last edit by Shiva sheela. Contributor trust: 40 [recommend contributor]. Question popularity: 56 [recommend question]
|
Research your answer: |



