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


Jamil Jones
Jamil Jones
10,852 Points

Stuck on this challenge for C Arrays

<html> <p>Declare 2 separate variables of type char named "alpha" and "bravo". Assign the letter 'a' to the variable "alpha" and the letter 'b' to "bravo".<p> <p>This is how I am doing it.<p>

<p> char alpha = a;</p><br> <p>char bravo = b;</p>

Here is the link for the code challenge

<p> Thanks for your help</p>

2 Answers

The compiler is interpreting your code as a and b both being variables. To denote that something is a character, it needs to be surrounded by single quotes. For instance 'a' is the character a.

thanks Ben! great explanation!

yes ! basically it should look like this :

char alpha = 'a';
char bravo = 'b';

nothing better than a visual aid! Thanks Natacha!