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

Print Character Array

I'm stuck on a code challenge on task 4 of 4 on the "arrays" section in C foundations. I'm supposed to be able to make the line print "letters a b". This is what I have. I can't figure out what I have wrong.

char alpha='a'; char bravo='b'; char letters[2]={alpha,bravo};

printf("leters %c %c \n",letters[0],letters[1]);

2 Answers

Nevermind. I'm dumb. I found my problem

If you're not doing this already, try typing your code for iOS challenges directly into XCode before pasting it into the answer box. This will help you quite a bit since XCode can easily give you warnings or error messages if you're getting something wrong.

However in this case there's nothing wrong with your code; it was just a typo in the printf statement.

excellent idea. The code completion makes everything so much faster and adds the braces around nested method calls which are easy to miss in just the treehouse editor.