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

Michael Woodcock
Michael Woodcock
3,094 Points

The question is confusing

I have implemented all that is required of this challenge in Xcode and it runs great. I am not sure what exactly this is asking for.

Stone Preston
Stone Preston
42,016 Points

please post the code you have tried

Stone Preston
Stone Preston
42,016 Points

please post teh code you have tried so far. cant help you without knowing what you are trying

Michael Woodcock
Michael Woodcock
3,094 Points

I've tried the following:

float var1 = 22;
float var2 = 33;
addTwo(var1,var2);

and also:

float addTwo(var1, var2){ float sumVar = var1 + var2; return sumVar; }

1 Answer

Stone Preston
Stone Preston
42,016 Points

the challenge asks for you to write a function called addTwo that takes two floats as arguments and returns the sum of the floats. it should look something like this:

float functionName(float floatOne, float floatTwo) {

    return something;

}

now thats not the answer to the challenge, but it should help you out. you need to fill in the function name and also figure out what to return

Michael Woodcock
Michael Woodcock
3,094 Points

Thanks. I was defining the "floatOne", "floatTwo" outside the function.

Stone Preston
Stone Preston
42,016 Points

no problem. yeah all it wants is the function itself, you dont have to use it or anything, just implement it.