Exercises
-
22.4 (Defining Structures) Provide the definition for each of the following structures:
Structure
Inventory
, containing character arraypartName[30]
, integerpartNumber
, floating-pointprice
, integerstock
and integerreorder
.A structure called
Address
that contains character arraysstreetAddress[25], city[20]
,state[3]
andzipCode[6]
.Structure
Student
, containing arraysfirstName[15]
andlastName[15]
and variablehomeAddress
of typestruct Address
from part (b).Structure
Test
, containing 16 bit fields with widths of 1 bit. The names of the bit fields are the lettersa
top
.
-
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.