Contents

Which of the following cannot be a structure member?
a) Another structure           
b) Function
c) Array                                
d) None of these

b

What are the types of data allowed inside a structure?
a) int, float, double, long double
b) char, enum, union
c) pointers and Same structure type members
d) All the above

d

What is actually passed if you pass a structure variable to a function?
a) Copy of structure variable
b) Reference of structure variable
c) Starting address of structure variable
d) Ending address of structure variable

a

Explanation: Yes. If you pass a structure variable by value without & operator, only a copy of the variable is passed. So changes made within that function do not reflect in the original variable.


Which of the following return-type cannot be used for a function in C?
a) An array stores only elements of same type. Accessing elements is easy
b) A structure is preferred when different type elements are to be combined as a single entity
c) An array implementation has performance improvements to structure
d) All the above

b

Which properly declares a variable of struct foo?
a) struct foo;                        
b) struct foo var;
c) foo;                                   
d) int foo;

What is actually passed

b

What is actually passed if you pass a structure variable to a function?
a) Copy of structure variable
b) Reference of structure variable
c) Starting address of structure variable
d) Ending address of structure variable

a

Explanation: Yes, If you pass a structure variable by value without & operator, only a copy of the variable is passed. So changes made within that function do not reflect in the original variable.