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) Fundamentals of C Variables

Still get "hello world"

I think I asked this question in the wrong location, so I'll try here again:

I've added the 3 variables (and removed the previous hello world printf line) and get no errors when I compile/run, but the output is still hello world. Which has me baffled. Not sure how to add a screen shot. I've checked the file location, changing directory, etc but still get hello world. Any suggestions?

2 Answers

Holger Liesegang
Holger Liesegang
50,595 Points

Welcome to Treehouse, Matthew Lawrence !

Can you please post your code? It should look something like this:

#include <stdio.h>

int main()
{

    int days_in_a_week = 7;
    float cm_to_in = 2.54;

    char the_w;
    the_w = 'W';


    printf("%d days in a week.\n", days_in_a_week);
    printf("%f cm per in.\n", cm_to_in);
    printf("The %c is a cool hotel\n", the_w);

    return 0;
}

Yup, that's what my code looked like. I gave up, deleted all my folders and started all over again with a brand new project (no copying an pasting of old projects) and now Xcode works as it should. I have no idea what was happening but it seems fine now. Definitely wasn't a problem with the code I was writing, but something to do with where Xcode was looking for the executable.

Thanks for the response, though!