Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

I need some explanation regarding this code...

I am trying to understand better the fundamentals of Objective-C, so I am currently learning from Aaron Hillegrass and Mikey Ward's "Objective-C Programming The Big Nerd Ranch Guide".

Currently covering the return in a function. Here is my code:

#include <stdio.h>

float fahrenheitFromCelsius(float cel)
{
    float fahr = cel * 1.8 + 32.0;
    printf("%f Celsius is %f Fahrenheit.\n",cel, fahr);
    return fahr;
}

int main(int argc, const char * argv[]) {
    float freezeInC = 0;
    float freezeInF = fahrenheitFromCelsius(freezeInC);
    printf("Water freezes at %f degrees Fahrenheit. \n",freezeInF);
}

The output is: "0.000000 Celsius is 32.000000 Fahrenheit. Water freezes at 32.000000 degrees Fahrenheit. Program ended with exit code: 0"

My question is when freezeInC is assigned to 0, how does it connect to the cel value in the fahrenheitFromCelsius Function.

In short, what is the connection between feezeInC to cel?