Maximum size of an string ?

Ali Çehreli acehreli at yahoo.com
Thu Nov 14 03:50:27 PST 2013


On 11/14/2013 02:10 AM, Jean Christophe wrote:

 > Has someone tested the maximum size of a D string variable for both 32
 > and 64 bits platforms ? Is it different from the maximum size of a 
char[] ?

Both string and char[] are implemented in the same way: a size_t for 
length and a pointer to data. (D arrays know their sizes.)

So, the theoretical limit for both are size_t, which is the equivalent 
of uint or ulong dependending on 32-bit versus 64-bit.

Ali



More information about the Digitalmars-d-learn mailing list