array.reverse segfaults

Moritz Warning moritzwarning at web.de
Wed Oct 22 03:16:40 PDT 2008


Hi,

This piece of code segfaults on Debian Linux (with dmd 1.035):
Can someone tell me why?

char[] get(char[] str)
{
    return new char[](4);
}

void main(char[][] args)
{
    char[] str =  get("abc");
   char[] reversed = str.reverse; // <-- access violation
}



More information about the Digitalmars-d mailing list