Linked by Owen Anderson on Mon 19th Apr 2004 05:43 UTC
General Development For years the development scene has been dominated by the C family of languages, primarily C itself and its immediate successor C++. Recent years have given rise to other C-descendents, however, such as Sun's Java and Microsoft's C#.
Permalink for comment
To read all comments associated with this story, please click here.
RE: empty strings
by Marcus Sundman on Mon 19th Apr 2004 15:08 UTC

> However, D strings, because they are just arrays of chars,
> know their own length. Hence you don't need to and
> probably shouldn't rely on the null byte to mark the end

I wasn't. The problem is that apparently an empty char array is equal to no array at all. This is clearly a Bad Thing(tm) since there is very much difference between 'str="";' and 'str=null;'. E.g. in java you can do this 'char[] str=new char[0];' which will get you an empty array, which is a completely other thing than just 'char[] str=null;' or 'char[] str;'.