Question: #include struct HorchateRecipe { char ingredient [ 3 0 ] ; int quantity; struct HorchataRecipe * nextIngredientAddress; } ; int main ( ) {
#include
struct HorchateRecipe
char ingredient;
int quantity;
struct HorchataRecipe nextIngredientAddress;
;
int main
struct HorchataRecipe ingredientRice;
struct HorchataRecipe ingredientSugar; # of cups
struct HorchataRecipe ingredientMilk; # of cups
struct HorchataRecipe ingredientCinnamon; # of packets
struct HorchataRecipe first; create a er called first to the first element in structure
first &ingredient;
ingredientnextIngredientAddress &ingredient;
Your assignment..if you choose to accept... is to populate
the nextIngredientAddress for the remaining ingredients and then print out all the names of the ingredients
XN
set ingredients nextIngredientAddress to ingredient
set ingredients nextIngredientAddress to ingredient
set ingredients nextIngredientAddress to NULL
HINT: There's two ways to print out the values
er method:
printfd s
firstquantity, firstingredient;
printfd s
firstnextIngredientAddressquantity, firstnextIngredientAddressingredient;
printfd s
firstnextIngredientAddressnextIngredientAddressquantity, firstnextIngredientAddressnextIngredientAddressingredient;
Explicit Reference to each ingredient
printfd s
ingredientquantity, ingredient ingredient;
printfd s
ingredientquantity, ingredientingredient;
printfs
s
s
s
;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
