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 trialcharlescho
4,219 Pointsfollowed the function video to build a function that works in xcode to add two floats together however doesn't work here
float addTwo(float a, float b);
int main()
{
float a = 1.0;
float b = 2.0;
printf("addTwo %f\n", addTwo(a, b));
return 0;
}
float addTwo(float a,float b) {
return a + b;
}
Here's the build
2 Answers
Steve Hunter
57,712 PointsYou've done too much - the question states No need to write the main function. Just write out the implementation for the addTwo function. So you just need to enter the function you have, correctly, written:
float addTwo(float a, float b) {
return a + b;
}
Steve.
charlescho
4,219 PointsThanks for the help Steve, I have closure now...