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
Shuddha Chowdhury
3,817 PointsC array code challenge help
Here is the code challenge : Declare an array of type 'char' called "letters" with a size of 2. Assign the variable "alpha" as the first element of the array "letters".
I tried with this code
char letters[2];
letters[0] = 'alpha';
But it didn't work.Any help please?I don't understand whats wrong here.
4 Answers
Gary Luce
7,153 PointsYou have just assigned a string value to 1st element of letters[], but you are asked to assign the variable alpha you have previously created in the 1st challenge.
If this first sentence doesn't give you a good enough hint, try playing with the syntax in your last line, it is almost correct.
Rafael Conde
8,127 PointsExactly, you are assigning the string 'alpha' and not the variable alpha ;)
Shuddha Chowdhury
3,817 PointsYes,Just got it right :) ..Thanks for helpful expression.Its always great to learn from mistakes :)
Gary Luce
7,153 PointsNo problem!