c - Alignment of byte array in struct -
i wondering standard how following structure aligned , allocated: struct { uint8_t b[16]; }; to extend can expect a of size 16 bytes, aligned on 16 byte boundary in array (and size of a[n] equal 16*n , e.g. no padding) , address of a first element of b ? and narrow scope bit, platforms concerned x86/x64, arm m, r, , a50. edit: clarification - "alignment" mean how compiler align objects in array on stack, e.g. each next element 16 bytes away, naturally not expect malloc aligned on platform default boundary. edit 2: after reading on answer, feel inclined ask, extend can expect platform-specific explicit alignment intrinsics work? the size of struct @ least 16. 16 in normal c implementations, not see c standard requires this, absent extenuating circumstances such special requests user. e.g., if user uses gcc’s extensions specify struct must have alignment of 32 bytes, struct have padded 32 bytes. the struct cannot expected have alignment requireme...