In the below structure, lets say
the size of the structure add will be 8 bytes because of structure padding concept that 3 bytes will be padded to the char y. Because, according to my understanding, as the processor will request the memory for words(i.e., 4 bytes) and as char in this structure will have only 1 byte, extra 3 bytes need to be padded.Code:struct add { int x; char y; };
But lets say, a normal character variabel is delcared in a program as
then in the memory for the variable c, only 1 byte will be allocated, then how the processor will request this memory using word...without padding?Code:int main { char c = 1; return 0; }