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

declare a float that is a size 5

So would it be 15 bytes in 5 floats im not sure what its asking

Declare a float array of size 5, i.e. 5 floats in the array

Mike Baxter
Mike Baxter
4,442 Points

John, shouldn't that be called "count" and not "size"? Unless I'm mistaken, a 32-bit float should have size 4 (sizeof(float) in C is returned in bytes), so a 5 float array should have a size of 20, right? Maybe "size" is poor wording for that question?

1 Answer

Or length... depending on the language you are used to. And yea, the question could be worded better.

You don't need to know the actual size of a float in this case, just use the syntax for defining an array that allows you to specify the number of elements.