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

real_numbers

Hey guys, I have looked at other discussions on this problem and have exhausted every possible solution. The challenge is: "Declare a float array named real_numbers that will hold 5 float numbers." My answer to this was initially this;

float real_numbers[ ] = {1.1, 2.2, 3.3, 4.4, 5.5}

But then after seeing that was wrong, I tried this;

float real_numbers[5] = { }

Still, after putting this as my answer, I am still receiving the message, "Bummer! Remember when declaring arrays, the size of the array is placed in box brackets: name_of_array[2]."

Please tell me how or if i can fix this problem and whether I should just move on. Thank you in advance for your help!

2 Answers

Stone Preston
Stone Preston
42,016 Points

The task is: Declare a float array named real_numbers that will hold 5 float numbers.

All you need to do is declare the array, not assign it any value:

float real_numbers[5];

Yes it appears I did everything right except put the semicolon after my statement. :P Darn careless mistakes! Thank you for your help!