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

Printf 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

Hey 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));

Totally worked! Thanks man

No problem dude!