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 Arrays

how is my array wrong?

I seem to not get the test questions right? [ char alpha[] = {a}; ]

2 Answers

Stone Preston
Stone Preston
42,016 Points

you are not asked to make a char array named alpha, you are asked just for a char variable named alpha.Here is a hint: to create a char variable:

char someCharVariable = 'z';

when we apply the box brackets to a variable, then we mean to define an array, where as when defining a simple variable no box brackets[ ] are required. All character values are enclosed with in a pair of single quotes ' '

char alpha='a';

I hope you get it now....