String convention

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sat Jul 1 14:17:33 PDT 2006


See also my other post, made just before I saw this one. This is a summary.

Niklas Ulvinge wrote:
> In article <e86l86$1364$1 at digitaldaemon.com>, Kirk McDonald says...
> Thanks for clearing things up a bit.
> 
> First, if the data don't have a terminator, then they can't have a big(infinity)
> size.

Nor can it *with* a terminator. Your computer's memory has a finite 
size, deal with it :).

> This is becouse, s.length need to be a variable. And that variable has got to
> have a size, wich makes it impossible to make big arrays.
> 
> I only need to rewrite my Q's...
> What type is s.length(or for that matter any dynamic array's size)?

Should be a size_t.
size_t.max >= (addressable memory).sizeof - 1
So the theoretical maximum length string is as large as it could be with 
a terminator. Assuming your OS lets you use that much, which it 
typically won't.



More information about the Digitalmars-d mailing list