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

stuck on challenge

I took notes for this lesson specifically so that I wouldn't get stuck on the challenge and here I am, stuck on this challenge. Can someone please tell me what I'm clearly doing wrong here?

! arraychallenge

1 Answer

Stone Preston
Stone Preston
42,016 Points

your output string is incorrect and you need to print the size of the variable, not the data type. the task states: Using the printf function print the size in bytes of the variable real_numbers. Your output should look like the following: Array real_numbers is x bytes.

so you need to make sure you output string will say " Array real_numbers is x bytes" but replace x with a format specifier, then as the other argument pass in the sizeof the array variable

float real_numbers[5];
printf("Array real_numbers is %ld bytes", sizeof(real_numbers));