Question: Write a function twoLightestCatWeight () that takes an array of cat structs (cat* a_cats) and the size of the array (unsigned int numCats) as input

Write a function twoLightestCatWeight() that takes an array of cat structs (cat* a_cats) and the size of the array (unsigned int numCats) as input parameters. The function then returns the weight for the two lightest cats using the following struct:

struct twoLightest { double firstLightest; double secondLightest; };

An array of struct is an array that its elements are instances of the struct and you can access each element using index (e.g., a_cats[0].weight would have the weight for the cat instance in index 0 in the array).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!