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!
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
Challenge Task: Pointers and Memory
Declare a float array named real_numbers that will hold 5 float numbers.
one of the answers is: float real_numbers;
could it also be?: float real_numbers;
RASHU BHATNAGARCourses Plus Student 2,669 Points
If the array needs to contain 5 elements , then it needs to be defines as: float real_numbers; where as the indexes will be starting from 0 to 4 , so altogether it will be containing 5 elements, with the first element starting from index 0 (real_number) and last element will be of index 4 (real_number)
I hope it clarifies your confusion a little more...
Scott Evans4,236 Points
To be blunt, no. If you want 5 element within the array you would have to specify 5.
I can see where your confusion is coming from though, the fact that array indexes start at 0. Just a slight misconception.