Type of Array.length?

Pragma ericanderton at yahoo.removeme.com
Fri Jan 19 13:35:36 PST 2007


Heinz wrote:
> Hi,
> 
> I just want to know what type is the one returned by the .length property of an array.
> 
> Thanks.

I think it's defined as an int (or possibly uint).  If you're concerned about 32/64 bit compatibility then it's 
recommended that you use "size_t".

http://www.digitalmars.com/d/portability.html

"Use size_t as an alias for an unsigned integral type that can span the address space. Array indices should be of type 
size_t."

-- 
- EricAnderton at yahoo


More information about the Digitalmars-d-learn mailing list