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
C Thurm
3,357 PointsArrays
This is my code:
''' 'c'
char alpha = 'a'; char bravo = 'b';
char letters[] = {a, b}; printf("letters %c %c", letters[0], letters[1]);
'''
treehouse editor throws this error: Bummer! The correct format character for a 'char' is '%c'.
What's up with this? figured it out
"char letters [2] = {alpha, bravo};"
3 Answers
agreatdaytocode
24,757 PointsHere is the correct answer:
char alpha= 'a'; char bravo='b'; char letters[2]; letters[0]=alpha; letters[1]=bravo;
printf("letters %c %c", alpha,bravo);
agreatdaytocode
24,757 PointsC Thurm, use the ``` on the tilde key the one that looks like ~ This will help your code stand out. It look me a good month to figure that out. I was also using the '''
Like This
brycecampbell
2,112 Pointschar alpha= 'a'; char bravo='b'; char letters[2]; letters[0]=alpha; letters[1[=bravo;
printf("letters %c %c./n", a,b);