Hi All,
Code:
#include<stdio.h>
struct node
{
char p;
char c;
char d;
//int a; //---------------------- Number 1
};
int main()
{
struct node a;
printf("size of node a:%d",sizeof(a));
getch();
return 0;
}
Here the Output is
3
Questions
1. If only char variables are present how will the processor access the memory address?
Assuming processors with fewer pins?
2. Shouldn't the variables be aligned at boundaries multiples of 2? What are criteria's for alignment of variables at even boundaries(basically when all)?
3. Introduction of Number 1 line will change the entire picture and structure is padded?
Thanks in advance