Exercises
-
22.4 (Defining Structures) Provide the definition for each of the following structures:
Structure
Inventory, containing character arraypartName[30], integerpartNumber, floating-pointprice, integerstockand integerreorder.A structure called
Addressthat contains character arraysstreetAddress[25], city[20],state[3]andzipCode[6].Structure
Student, containing arraysfirstName[15]andlastName[15]and variablehomeAddressof typestruct Addressfrom part (b).Structure
Test, containing 16 bit fields with widths of 1 bit. The names of the bit fields are the lettersatop.
-
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access