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

Functions code Challenge

well i need more help on functions, i've seen the video many times but i can never get the challenge right!! Help!!

link the actual challenge and post the code you are using.

http://teamtreehouse.com/library/functions

Code: float addTwo = (float 1, float 2); return 1 + 2;

ok so you need to create a function but your code looks like you are declaring something.

""" float addTwo(param1 param2){

code; }

4 Answers

you are not supposed to declare something you have to create a function. i think you should watch video of how to create a function once again. Don't over think its simple just do what they say.

good luck.

still not sure

ok so try doing this

float addTwo(float a, float b){

  return a + b;
}

1) float is a type of function 2) addTwo is a function name 3)float a, float b are parameters in your case you have declared numbers which is not right. 4) inside the curly braces we are returning the sum of two floats.

hope you got it

i had already got it before u gave it to me but thanks anyway

good job

thanks

Hi i found this really helpful i was stuck on it but was making it more complicated than it should've been.

I was stuck on the same challenge, thank you amitreddy!

Thanks amit reddy, was stuck on this, and was looking for solutions through previous lessons and my Xcode files.