Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Objective-C Basics (Retired) Pointers and Memory Array Size and Length

I've only been able to get a struct declaration to work if I fill it with float variables. Char doesn't work? Why?

I've tried using char variables in a struct declaration, but get the error "Incompatible pointer to integer conversion assigning to 'char' from 'char[2]'." So far, the only variables that work seem to be float. I haven't tried integers. When declaring struct variables, can you only popular it with numbers? Here's the code I attempted that wouldn't compile:

typedef struct { char make[3]; } car;

int main{ car favorites; favorites.make[0] = "Ford"; favorites.make[1] = "Toytoa";

printf("Favorite car makes: %c %c", favorite.make[0], favorite.make[1]); }

What am I doing wrong?

array_length.mm