struct { int index; char string[10]; } a[10];
introduces addition for each element a[] .
The second solution will introduce padding only once.
If you are going to highlight a large number of elements in a[] , then you will pay the price for expanding a larger domain (not to mention the additional dereferencing).
source share