by xcgvgh · 10y ago · 0 comments
>>No, it isn't.
Could anyone elaborate?
I don't see how could someone allocate more than SIZE_MAX bytes with (m/c/re)alloc since they all take size_t as an argument, and size_t is the type used for defining array sizes. Thus size_t can hold the largest array index (in fact it can hold the largest_index+1 since arrays are zero based). Any counterarguments?
But yes, he may be arguing the definition rather than meaning.
If I change the argument to: size_t is capable of holding the largest array index", then this must be correct, or is there still something I missed?