Structure
Question 1 |
Consider the following declaration:


person.name +2 | |
kd → (name +2 ) | |
*((*kd).name + 2 ) | |
either (a) or (b), but not (c) |
Question 1 Explanation:
*(kd -> name +2) /* this is wrong statement */
We have to write *((*kd).name+2).
Note: They are specifically asked about a value stored at that location of the string by using "*" outside the brackets. Otherwise, option A and B would be correct.
We have to write *((*kd).name+2).
Note: They are specifically asked about a value stored at that location of the string by using "*" outside the brackets. Otherwise, option A and B would be correct.
Question 2 |
To sort many large objects or structures, it would be most efficient to place
them in an array and sort the array | |
pointers to them in an array and sort the array | |
them in a linked list and sort the linked list | |
references to them in an array and sort the array |
Question 2 Explanation:
● Pointers will point to large objects or structures.
● By using pointers we will easily access the large objects or structures with the help the addresses pointing to them.
● If you made any changes to the elements in the array, it automatically reflect as these are pointed by the pointers
● By using pointers we will easily access the large objects or structures with the help the addresses pointing to them.
● If you made any changes to the elements in the array, it automatically reflect as these are pointed by the pointers
Question 3 |
If initialization is a part of declaration of a structure, then storage class can be
automatic | |
register | |
static | |
anything |
Question 3 Explanation:
Storage class specifiers available in C programming language include 'auto', 'register', 'static' and 'extern'.Depending upon the developer requirement , the storage class is anything.
There are 3 questions to complete.
