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

Daniel Jurado
Daniel Jurado
2,118 Points

Dont understand why this wont work for the practice problem

Implement a function named "addTwo" that returns the sum of two floats. The function will accept two float numbers as arguments and return a float which is the sum of the two arguments passed to the function. (No need to write the main function just write out the implmentation for the addTwo function)

float addTwo(float a, float b); int main() { float alpha = 3.4; float beta = 4.5;

return addTwo(alpha, beta);

}

float addTwo(float a, float b) { return a + b; }

4 Answers

I'm assuming they don't want you to write out the main function as you have in your example. just write out the implementation like it says.

Daniel Jurado
Daniel Jurado
2,118 Points

Hey thank you... yea it was a bit vague initially but I just had to take it literraly. Did you learn to code on here??

Yes, I did! I also learned from Codecademy and Code School. I had intense C/C++ courses in college too, which is beneficial for what I do (I'm an electrical engineer).

Keep at it!

Daniel Jurado
Daniel Jurado
2,118 Points

Going through the iOS track on here. Did you feel it was sufficient? I just finished the C basics

Yes, the iOS track on Treehouse is one of the bests. I would also recommend Codeschool's iOS track as they have quite a few goodies as well.