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

Practicing using code pen. Whats wrong with this code.

<p data-height="268" data-theme-id="0" data-slug-hash="fscti" data-user="JoeyLoForti" data-default-tab="result" class='codepen'>See the Pen <a href='http://codepen.io/JoeyLoForti/pen/fscti'>fscti</a> by Joey LoForti (<a href='http://codepen.io/JoeyLoForti'>@JoeyLoForti</a>) on <a href='http://codepen.io'>CodePen</a></p>

#include <stdio.h>

float addTwo(float a, float b);
int main()
{
    float a = 2.561;
    float b = 3.523;

    float addTwo = a + b;
    printf("%f\n", addTwo);
    return addTwo;

}

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

Howdy Joey,

A few quick tips:

Firstly, it looks like your code area might not have encompassed the full area of code. Please be mindful of this next time you post, so the people on here can better help you. You might want to take some time to read up on Daring Fireball's Markdown Cheat Sheet.

Secondly, please add links to help us help you.

Thirdly, please post threads in the correct forum. This is a PHP question so it should be in the PHP forum.

Finally, based on what I am seeing, it looks like your code is lacking an opening curly braces on the top of the code.

Good luck, and welcome to Treehouse. ;)

EDIT: My bad. It looks like Objective-C, after editing your post and adding the appropriate mark down. Moved it to the iOS forum, all the more reason why you need to post in the correct forum. ;-P

2 Answers

James Barnett
James Barnett
39,199 Points

Code pen only does HTML, CSS & JavaScript (and their associated pre-processors). It doesn't support server-side languages for that you need http://ideone.com/

Huh, after looking at this, it looked like Objective-C to me. Am I wrong?

James Barnett
James Barnett
39,199 Points

Jessica Sideways - You're right, it's Objective-C.

I was responding to the forum post title "Practicing using code pen", but I may have gotten confused.

Thank you sir I will try ideone.com.

({[
#include <stdio.h>

float addTwo(float a, float b);
int main()
{
    float a = 2.561;
    float b = 3.523;

    float addTwo = a + b;
    printf("%f\n", addTwo);
    return addTwo;

}

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

Also, if you want to share more details about the thing you are having trouble with - please it as a comment to your original post. Right under your post, there is a link that reads "Comment". Please, use it to your advantage so that people see that your question hasn't been answered yet.

Thanks for the help. I don't know how I made a mistake like that. I appreciate your time.