why no implicit convertion?

Matthias Pleh sufu at alter.com
Wed Nov 17 13:10:19 PST 2010


void foo(char[] a) {}
void bar(char[][] b) {}

int main(string[] args)
{
     char[4] a;
     char[4][4] b;
     foo(a);        // OK: implicit convertion
     bar(b);        // Error: cannot implicitly convert
                    //        char[4u][4u] to char[][]
}

what is the reason for the different behaviour?
What's best to pass such multidimensional arrays?


More information about the Digitalmars-d-learn mailing list