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 trialJason Zeall
7,860 PointsTotally lost on how to implement the float numbers. The previous lesson was on integers? The addTwo question.
if I don't need to add the main function, do I still need to use the --> { } ?
and the return implementation, is that just adding a return 0? Or does it mean to printf?
Jason Zeall
7,860 PointsThanks Jeremy for the reply. Didn't know that the Treehouse community was quite active. I finally managed to pull through.
Thanks!
1 Answer
Michael Hulet
47,913 PointsAll you're doing is defining a C function. This code will pass:
//This tells the compiler that the function is named "addTwo", it returns a float, and it accepts 2 floats as parameters. One named "one", and one named "two
float addTwo(float one, float two){
//this line just adds the two floats that were passed in together and returns them
return one + two;
//This is just the closing curly brace to close the function
}
Jason Zeall
7,860 PointsThanks Michael! You saved me!
Jeremy Hayden
1,740 PointsJeremy Hayden
1,740 PointsCould you paste the question your stuck on? Also the code you have so far?