Type of Array.length?
Chris Nicholson-Sauls
ibisbasenji at gmail.com
Fri Jan 19 21:35:47 PST 2007
Heinz wrote:
> Alexander Panek Wrote:
>
>> Heinz wrote:
>>> Hi,
>>>
>>> I just want to know what type is the one returned by the .length property of an array.
>>>
>>> Thanks.
>> Easiest way to achieve the array is either:
>>
>> typeof(array.length) len;
>>
>> or:
>>
>> auto len = array.length;
>>
>>
>> You don't even have to really care for the type then, actually, and it
>> stays platform independent, anyways.
>
> Hi, thanks for your reply, i really like what yo did but i need this type to be fixed, not stored in a variable. Ok, now len is the same type as array.length, then what's the type of len? you know what i mean?
> The program knows the type but I need to know it too.
> Thanks man.
>
size_t
(Which is 'uint' on 32b systems, and 'ulong' on 64b.)
-- Chris Nicholson-Sauls
More information about the Digitalmars-d-learn
mailing list