Deleting Entries from an Array

Deewiant deewiant.doesnotlike.spam at gmail.com
Wed Jun 27 05:31:04 PDT 2007


Daniel Biehl wrote:
 > Why is it work with DMD 1.016 on Windows XP (not with GDC!!!), there comes no
> error. I know on Windows literals are not stored in read only memory, like on
> Linux, but why I can write on Windows with DMD char[] s = "Hello" and must
> write on Linux char[] s = "Hello".dup. Isn't it a little inconsitent? Maybe
> the compiler should make a .dup if a initialize a dynamic array variable?
> 

There's no reason not to allow char[] s = "Hello", you just can't write to it.

The const semantics in D 2.0 would catch this error.



More information about the Digitalmars-d mailing list