Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ChrisA

macrumors G5
Jan 5, 2006
12,911
2,157
Redondo Beach, California
There's something I don't quite understand. sizeof() returns a value of type size_t which, if I remember correctly, is defined as unsigned int. So I guess the results above are fine for 32bit architecture, but for 64 bit size_t wouldn't be big enough for all cases.

Out of interest perhaps you could print out the result of sizeof( size_t )?

thanks

b e n

"size_t" is the type that is used to hold the length of a object in memory, so by definition size_t is long enough to hold the length of a object in memory. Or to say it another way, it is impossible to define an object larger than what would fit in a variable of type size_t.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.