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

Info icon This 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
Image of page 1

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

View Full Document Right 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
Image of page 2
remaining members are automatically initialized to 0 or NULL . a) quantifiers b) initializers c) numerators d) variables ANS: (b) 10.13. Structures can be initialized in __________ statements. a) assignment b) null c) scope d) empty ANS: (a) 10.4  Accessing Members of Structures 10.14 Arrays are (a) always passed call by reference.
Image of page 3

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern