chtp5_10-TIF-Beta - 10.1Introduction 10.1 _ may contain...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
10.1  Introduction 10.1 ________ may contain different data types. (a) structures (b) arrays (c) both a and b (d) none of these ANS : (a) 10.2. __________ are collections of related variables—sometimes referred to as aggregates—under one name. a) Members b) Enumerations c) Structures d) Files ANS: (c) 10.3. Structures may contain variables of many different data types—in contrast to ___________ that contain only elements of the same data type. a) files b) arrays c) constants d) functions ANS: (b) 10.2  Structure Definitions 10.4 Two structure variables with the same member values (a) always compare equally. (b) never compare equally. (c) sometimes compare equally. (d) only compare equally if both structure variables contain holes. ANS : (c) 10.5 What does the deck[52] array contain in the following statement? struct card a, deck[52], *cPtr; (a) card structure elements (b) a structure elements (c) * cPtr elements (d) none of these ANS: (a) 10.6. Keyword __________ introduces the structure definition. a) structure
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
b) str c) strdef d) struct ANS: (d) 10.7. A structure containing a member that is a pointer to the same structure type is referred to as a __________ structure. a) self-referential b) self-describing c) self-aggrandizing d) self- elemental ANS: (a) 10.8. Which statement is false? a) Structures are derived data types. b) Each structure definition must end with a semicolon. c) A structure can contain an instance of itself. d) Structures may not be compared using operators == and != . ANS: (c) 10.9. Which of the following is not a valid operation on a structure? a) Assigning structure variables to structure variables of the same type. b) Taking the address of a structure variable. c) Using the sizeof operator to determine the size of a structure variable. d) Comparing structures of the same type with relational operators. ANS: (d) 10.3  Initializing Structures 10.10 Structure variables may not be initialized by (a) setting user-defined defaults in the struct definition. (b) assigning values to individual data members. (c) array-like member initializer lists. (d) assignment statements. ANS : (a) 10.11 What does the following statement do? struct card a = { “Three”, “Hearts” }; (a) It creates a variable card of type struct with two members specified in the list. (b) It creates two variables named Three and Hearts of type struct card a . (c) It creates a variable a to be of type struct card and initializes it to the values in the list. (d) It creates two variables named Three and Hearts of type struct card . ANS: (c) 10.12. If there are fewer __________ in the list than members in the structure, the
Background image of page 2
remaining members are automatically initialized to 0 or NULL . a) quantifiers
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

chtp5_10-TIF-Beta - 10.1Introduction 10.1 _ may contain...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online