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 trialtajiflynn
206 PointsCode 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
9,278 PointsHey! 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
tajiflynn
206 PointsOk. Thank you so much. I think that is where I may have gone wrong. But we will see. Thank you again!
Lachlan Mitchell
9,278 PointsNo worries!
tajiflynn
206 PointsSorry to ask another question, but what happens when "output.html" shows up.
Lachlan Mitchell
9,278 PointsYou 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 :)
tajiflynn
206 PointsWhat happens if it says the code is wrong?
Lachlan Mitchell
9,278 PointsThen the code must be wrong :p Post what you're typing in so I can have a look at it.