Exercises

  1. 22.4 (Defining Structures) Provide the definition for each of the following structures:

    1. Structure Inventory, containing character array partName[30], integer partNumber, floating-point price, integer stock and integer reorder.

    2. A structure called Address that contains character arrays streetAddress[25], city[20],

      state[3] and zipCode[6].

    3. Structure Student, containing arrays firstName[15] and lastName[15] and variable

      homeAddress of type struct Address from part (b).

    4. Structure Test, containing 16 bit fields with widths of 1 bit. The names of the bit fields are the letters a to p.

  2. 22.5 (Card Shufflling and Dealing) Modify Fig. 22.16 to shuffle the cards using the shuffle algorithm in Fig. 22.3. Print the resulting deck in two-column ...

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.