here is a program..
struct st
{
char ch[3];
int a;
}st_var={"ABC", 68};
void main()
{
printf("%s",st_ var.ch);
}
If there is continuous allocation then the output will be
ABCD
now...suppose tht the memory is not allocated continuously..
the first 3 bytes are allocated at 1 place and next 2 bytes are
allocated at other place
wht will be the output....???
struct st
{
char ch[3];
int a;
}st_var={"ABC", 68};
void main()
{
printf("%s",st_ var.ch);
}
If there is continuous allocation then the output will be
ABCD
now...suppose tht the memory is not allocated continuously..
the first 3 bytes are allocated at 1 place and next 2 bytes are
allocated at other place
wht will be the output....???
Comment