Moving from Java to a different language (29)

21 Name: #!/usr/bin/anonymous : 2006-08-08 01:16 ID:pEdf7Ula

>>19
that only looks like a problem if you assume that

char[] poit = "hurble burble";

is the equivalent of

char *poit = "hurble burble";

which it would be, more or less, in C (but may not necessarily be in D, which I know nothing about).

If, on the other hand, in D,

char[] poit = "hurble burble";

is the equivalent of

char *poit = strdup ("hurble burble");

then when you change the value of poit[x] you aren't modifying the string literal, you're modifying the array, which is completely sane.

This thread has been closed. You cannot post in this thread any longer.