Structure & Union

1. Which of the following are themselves a collection of different data types?

A. String
B. Structures
C. Char
D. None of the above

View Answer

2.Which operator connects the structure name to its member name?

A. -
B. ->
C. .
D. both . and ->

View Answer

3. Which of the following cannot be a structure member?

A. Function
B. Array
C. Structure
D. None of the above

View Answer

4. What is the correct syntax to declare a function foo() which receives an array of structure in function?

A. void foo(struct *var);
B. void foo(struct *var[]);
C. void foo(struct var);
D. none of the mentioned

View Answer

5. Union differs from structure in the following way

A. All members are used at a time
B. Only one member can be used at a time
C. Union cannot have more members
D. Union initialized all members as structure

View Answer

6. The size of the following union, where an int occupies 4 bytes of memory is
    union demo     {     float x;     int y;     char z[10];     };

A. 8 byte
B. 4 byte
C. 10 byte
D. 18 byte

View Answer

7. Members of a union are accessed as________________.

A. union-name.member
B. union-pointer->member
C. Both a & b
D. None of the mentioned

View Answer

8. It is not possible to create an array of pointer to structures.

A. True
B. False

View Answer

9. Which of the following statement is True?

A. User has to explicitly define the numeric value of enumerations
B. User has a control over the size of enumeration variables.
C. Enumeration can have an effect local to the block, if desired
D. Enumerations have a global effect throughout the file.

View Answer

10. size of union is size of the longest element in the union

A. Yes
B. No

View Answer

Also check :


* You must be logged in to add comment.