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 trialRyan Kennedy
2,771 PointsPrintf help
float real_numbers[] = { 1, 12, 13, 123, 132}; printf("Array real_numbers is %ld bytes.\n", sizeof(float));
Above is what I am typing in and getting a wrong answer. I need to use the printf function to print the following: "Array real_numbers is x bytes." Any help is greatly appreciated thank you
1 Answer
Kevin Kenger
32,834 PointsHey Ryan,
It wants you to find the size of the real_numbers
variable specifically, not just the size of a float variable.
printf("Array real_numbers is %ld bytes.\n", sizeof(real_numbers));
Ryan Kennedy
2,771 PointsRyan Kennedy
2,771 PointsTotally worked! Thanks man
Kevin Kenger
32,834 PointsKevin Kenger
32,834 PointsNo problem dude!