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
Colton Whited
516 PointsDeclare a float array named real_numbers with the size of 5.
The question seems really straight forward, but for some reason I keep getting the stupid bummer thing so obviously I am doing something wrong. Ideas? Here is what I have so far...
float real_numbers [] = (3.11, 3.414, 5.17, 5.19, 3.12);
Y'all are awesome by the way!! Thanks for all the help as I learn this new language of coding!! :)
5 Answers
Steven Prescott
19,206 Pointsfloat real_numbers[5] is how you would give the array a size of five. Also, the declarations should be in brackets {} not commas ().
-- Steven
If that solved your problem, please click Best Answer.
Robert Uhler
3,637 PointsPutting real_numbers[5]; creates an empty an array with a length 5. So you have 5 indexes available, 0 ,1, 2, 3, 4.
Chris Adamson
132,143 PointsThe answer they are looking for is:
float real_numbers[5];
Colton Whited
516 PointsNice! Thanks man. Yeah, I realized that after I posted it haha. I thought it was wanting 5 different numbers to make the array length 5. What does it mean if you put the five in [ ]?
Karim Fazulzyanov
472 Pointsso what is the answer?