Home Segments Index Top Previous Next

523: Mainline

Recall that the industry_name function, as defined in Segment 498, takes an argument that is a trade pointer and returns the name of an industry:

char* industry_name (struct trade *t) { 
  switch (t -> industry) { 
    case food: return "Food"; break; 
    ... 
  } 
} 

Now you need to modify the industry_name function such that it uses the character string obtained from the description structure variable of a trade object.