I am using code::blocks 12.11 (gcc) on a 32 bit OS. I have the following structure:
struct node
{
int a;
float b;
char d;
struct node* c;
}
s1;
now individually,
sizeof(int); sizeof(float); sizeof(char);
gives output 4 4 1 bytes respectively. so i calculate size of structure as 13 bytes. But the following
sizeof(s1); or sizeof(struct node);
gives output 16bytes.
I am unable to figure out why this is so. Please help me out here. Thanks.