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 trial

iOS Objective-C Basics (Retired) Functional Programming in C Functions

Function with two different parameter types

What if a function had two different parameter types? What would the function type be? The following function has two int parameters:

int funky_math(int a, int b);

But what if the parameters were (float a, int b)?

3 Answers

Paolo Scamardella
Paolo Scamardella
24,828 Points

What do you mean? I'm no iOS developer, but if you are asking what type the function will return, it would be an integer because of the int in front of the function. It doesn't matter the types of parameters as long it returns an integer. So if you had a function like string funky_match(int a, int b) and inside the function you do some kind of processing and return a string, that would be valid.

Thanks Paolo I think I had a mind lapse!