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

Code Challenge

On the code challenge, what does variable has incomplete type "void". I should have everything else right. But I can't seem to get past this one error.

4 Answers

Lachlan Mitchell
Lachlan Mitchell
9,278 Points

Hey! Without seeing your code it's a little hard to say exactly where you've gone wrong. Remember that a standard function signature in c follows the following format: returnType name(paramType paramName).

The question states that we should pass in two floats as parameters, call the function addTwo and have it return a float. From this information, we can write the signature!

float addTwo(float a, float b) {
    return a + b;
}

The return statement simply returns the product of the parameters a and b. Note that it will return a float, because a and b are floats.

I hope that helps! Reply if you need any additional guidance.

  • Akyri

Ok. Thank you so much. I think that is where I may have gone wrong. But we will see. Thank you again!

Sorry to ask another question, but what happens when "output.html" shows up.

Lachlan Mitchell
Lachlan Mitchell
9,278 Points

You must have clicked Preview. If your code outputs something (like from a print statement), then it will show up there. This particular code challenge doesn't output anything, so all you have to do is click Check work. You can forget about Preview for now :)

What happens if it says the code is wrong?

Lachlan Mitchell
Lachlan Mitchell
9,278 Points

Then the code must be wrong :p Post what you're typing in so I can have a look at it.