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

Laura Paxton
Laura Paxton
2,304 Points

Challenge task 2/3 on printing the statement, "Array real_numbers is x bytes." I'm lost. Have tried everything.

Not sure what else to say. printf ("Array %ld is x bytes.\n", sizeof (real_numbers)); is not correct. Does it need to say the statement above exactly as phrased in the question? For example, does it need the word, "is?" Should it say "x bites" or have the actual number of bytes.

2 Answers

Gareth Borcherds
Gareth Borcherds
9,372 Points

You need to replace x with the %ld not the real_numbers part :)

printf("Array real_numbers is %ld bytes.\n", sizeof(real_numbers));

Laura Paxton
Laura Paxton
2,304 Points

Thanks! I can't believe I did that. But now I'm having trouble with the 3rd task also.

Laura Paxton
Laura Paxton
2,304 Points

No worries. I did it. Yahoo! (I can't believe I figured it out, actually.)