size_t

Karl Heuer karl at haddock.ima.isc.com
Tue Jun 27 09:17:45 AEST 1989


In article <2284 at ubc-cs.UUCP> manderso at ugly.cs.ubc.ca (mark c anderson) writes:
>size_t is defined as the "unsigned integral type of the result of the sizeof
>operator", i.e. unsigned int (at least in this case).

Which just means that (in the case of TC huge model) both |size_t| and
|sizeof| are wrong.  If the compiler allows you to create object larger than
65535 bytes, then |size_t| should not be a 16-bit type.

>I'm not sure how Turbo C handles the huge memory model, but I was interested
>to read how Microsoft deals with it:  if you cast the result of a sizeof
>operation on a huge array to unsigned long, the correct result is produced.

A hollow voice says, "Kludgh".

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.std.c mailing list