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 Objective-C Basics (Retired) Functional Programming in C Functions

Functions

if someone can break this down for me. Apparently I'm really slow lol. HELP!!

3 Answers

Hi Carlos!

A function is a piece of code that is called that can carry out a certain activity for you such as finding the length of a string. A function can then return an output, if needed, which can then be used in other parts of your program.

Feel free to ask any more questions if you need help!

-Luke

Stone Preston
Stone Preston
42,016 Points

all you need is the function implementation. here is a shell of what your function should look like:

returnType functionName(dataType parameterOne, dataType parameterTwo) {

return something;

}

the challenge tells you it needs to be named add two, it needs to take two parameters. these parameters need to be of the type float. then you need to return the sum of the parameters. since you are returning the sum of 2 floats your return type needs to be a float.

note that I called the variables inside the parenthesis parameters. When implementing a function, the variables you put inside the ( ) are known as parameters. When calling a function, they are arguments.

thank you