so i just finished the example about computing the correct time to cook a turkey for in terms of its weight and i completely understand the principles and how it works, however, I’m still confused on one aspect. in the new function showCookTimeForTurkey, we declare an int pounds, however do not specify what pounds is, however, by running the application as a whole, it comes up with pounds based on the total weight in main.c. can someone please try and explain how total weight gets associated with the int pounds in the new function showCookTimeForTurkey? thanks a lot.
No responds to this yet?
Having the same problem…
Sorry for the delay on the answer. I was trying to find some brilliant way to explain this idea. But I didn’t come up with one. Here’s how I think about it:
Step 1. turkeyWeight in main() gets the value 11:
Step 2. That 11 gets pass to showCookTimeForTurkey() as a parameter:
Step 3. pounds gets that value:
Thanks for explaining that Aaron, I get it now.