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 trialDaniel Jurado
2,118 PointsDont 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
Stephen Whitfield
16,771 PointsI'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
2,118 PointsCool man!
Stephen Whitfield
16,771 PointsYes, 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
2,118 PointsGoing through the iOS track on here. Did you feel it was sufficient? I just finished the C basics
Stephen Whitfield
16,771 PointsYes, 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.
Daniel Jurado
2,118 PointsDaniel Jurado
2,118 PointsHey thank you... yea it was a bit vague initially but I just had to take it literraly. Did you learn to code on here??