Structure

Question 1
Consider the following declaration:
A
person.name +2
B
kd → (name +2 )
C
*((*kd).name + 2 )
D
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.
Question 2
To sort many large objects or structures, it would be most efficient to place
A
them in an array and sort the array
B
pointers to them in an array and sort the array
C
them in a linked list and sort the linked list
D
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
Question 3
If initialization is a part of declaration of a structure, then storage class can be
A
automatic
B
register
C
static
D
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.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access