Got a bit stacked at Turkey Timer.
Here’s the initial code
void showCookTimeForTurkey (int pounds)
int necessaryMinutes = 15 + 15 * pounds;
printf(“Cook for %d minutes.\n”, necessaryMinutes);
int main(int argc, const char * argv)
int totalWeight = 10; int gibletsWeight = 1; int turkeyWeight = totalWeight - gibletsWeight; showCookTimeForTurkey (turkeyWeight); return 0;
I DO understand that the program starts executing from MAIN.
So the machine comes across to the showCookTimeForTurkey function.
After that it comes to void that above the MAIN.
the question is - how it knows that the pound = 9.
As I understand, we calculate int turkeyWeight = totalWeight - gibletsWeight;
but in the void above MAIN there’s no mentioning any int turkeyWeight
Thanks for the explanation