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 trialql g
Courses Plus Student 125 Pointsfunction addTwo
function addTwo
function addTwo = ( float + float );
1 Answer
Juan Martinez
1,031 PointsIf this is from the objective-c programming course then I think you have the wrong idea on how to do functions. Functions are in the formant of returnType nameOfFunction( inputVariables) . For example to make a function that adds two numbers together you first implement it by doing this:
float addTwo( float a, float b );
then you define it by doing something like this:
float addTwo( float a, float b){ return a + b; }
Michael Pastran
4,727 PointsMichael Pastran
4,727 Pointshey is this part of a challenge?
functions have to start with
func not function
you also dont need " ; " at the end of your code.