strings and char arrays

llee llee at goucher.edu
Mon May 5 16:06:49 PDT 2008


With the release of dmd 2, char arrays have been replaced with strings. Many of the standard functions within Phobos no longer accept character arrays, and the strings that have replaced them are not terminated with null characters - making them incompatable with c functions. Equally important strings are immutable, meaning that they can not be modified after they are defined, and old code that used the word string for variable names and references no longer work. Why have strings been introduced? Why are they being used to replaced character arrays when they suffer from these limitations and introduce these problems? And, how can we convert between char arrays, and strings?



More information about the Digitalmars-d mailing list