22. Consider the following C-code fragment running on a 32-bit x86 machine:
typedef struct{
union{
Unsigned char a;
unsigned short b;
}
unsigned char c;
}S;
S B[10];
S*p=&B[4];
S*q=&B[5];
p→ U.b=0x1234;
/* structure S takes 32-bits */
If M is the value of q-p and N is the value of ((int) & (p→ c))-((int)p), then (M,N) is
typedef struct{
union{
Unsigned char a;
unsigned short b;
}
unsigned char c;
}S;
S B[10];
S*p=&B[4];
S*q=&B[5];
p→ U.b=0x1234;
/* structure S takes 32-bits */
If M is the value of q-p and N is the value of ((int) & (p→ c))-((int)p), then (M,N) is
ANS. C
Previous | Next |
UGC NET CS 2018 July - II Question 21 | UGC NET CS 2018 July - II Question 23 |
No comments:
Post a Comment