Consider the following declaration.
struct addr
{
char city [10];
char street [20];
int pincode;
};
struct
{
char name[20];
int sex;
struct addr locate;
} criminal, *kd * &criminal;
The third character in the criminal name can be accessed by
A. | criminal . name [2] |
B. | kd —> name [2] |
C. | ( (*kd) . name) [2] |
D. | All of these |
Option: D Explanation : Click on Discuss to view users comments. |
Consider the following declaration.
struct addr
{
char city [10];
char street [20];
int pincode;
};
struct
{
char name[20];
int sex;
struct addr locate;
} criminal, *kd * &criminal;
*(kd —> name + 2) can be used instead of
A. | * (criminal .name + 2) |
B. | * ( (*kd) .name + 2) |
C. | Both (a) & (b) |
D. | either (a) or (b), but not (c) |
Option: C Explanation : Click on Discuss to view users comments. |
Assuming that bit-fields are accomodated from right to left and word size is 16-bits
Consider the declaration
static struct
{
unsigned a : 5;
unsigned b : 5;
unsigned c : 5;
unsigned d : 5;
} v = (1, 2, 3, 4);
A. | first word |
B. | second word |
C. | in both words |
D. | none of the above |
Option: B Explanation : Click on Discuss to view users comments. |
Assuming that bit-fields are accomodated from right to left and word size is 16-bits
If the declaration unsigned c : 5; is replaced by unsigned : 6;
then,
A. | it results in a syntax error |
B. | it is meaningless |
C. | the compiler will give a new name for the field, which can be used in the program |
D. | none of the above |
Option: D Explanation : A bit-fiels need not be named Click on Discuss to view users comments. |
Assuming that bit-fields are accomodated from right to left and word size is 16-bits
A. | 1 word |
B. | 2 words |
C. | 3 words |
D. | 4 words |
Option: C Explanation : Click on Discuss to view users comments. |