I understand the structure alignment is 'implementation specific', but just wondering if there is any simple way to calculate the structure alignment, for example:
typedef struct
{
char c;
int i;
} test;
if sizeof(test) - (sizeof(char) + sizeof(int)) == 0 means alignment is 1 byte;
if sizeof(test) - (sizeof(char) + sizeof(int)) == 1 means alignment is 2 bytes;
// ...etc...
Is the above assumption reliably true?