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) 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.)