According to page 135 K&R (as well as this wikipedia page), the sizeof operator can be used to compute the size of an object and returns the size in bytes as an unsigned integer of type size_t. Since the max value of an unsigned integer is 2^32, what would happen if I was to call sizeof on an object that had a larger size in bytes than 2^32, like say something with a size of 2^34 bytes. What would sizeof return? And is there a way to get around this size limit?
I think you're reading it wrong.
"An unsigned integer" does not mean "the type unsigned int". It can also, for instance, be unsigned long long which can be (much) larger. Also, of course, there's no requirement or specification that says that unsigned int is limited to 32 bits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With