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 trialTrevor Wood
17,828 PointsNot sure how to do this, iOS problem
Not quite sure how to return the float value. There may also be some other areas i'm not doing correctly.
void addTwo(a,b){
int here = a+b;
printf("%s\n",here);
return 0;
}
1 Answer
Alex Hedley
16,381 PointsYou'll want to return here since that is the value of the two parameters added together.
void addTwo(a,b){
int here = a+b;
return here;
}
Trevor Wood
17,828 PointsTrevor Wood
17,828 PointsThanks Alex, but it says that I should also declare it a float somewhere.
Alex Hedley
16,381 PointsAlex Hedley
16,381 Pointsread it too quickly you'll want your method to return a float not be a void