I'm writing a simple program just to get started (se below).
     mat[i][z] = z; this line generate following error:
cannot implicitly convert expression `z` of type `ulong` to `char`

There are a number of ways to avoid this conversion, but I'm interested in best way to convert between types. How do I do this conversion best D practice.

Is there a cheet sheet where I can find preferably all possible conversions between types? That sheet would save me hours and hours and lots of screaming in agony.



    import std.stdio;
    void main()
    {
        writeln("Hello, world without explicit compilations!");
        auto xmat = [
            ['a','a','a','a','a','a','a','a']
           ,['*','*','*','*','*','*','*','*']
           ,['*','*','*','*','*','*','*','*']
        ];
    initmat(xmat);
    }

    void initmat (char[][] mat) {
    import std.conv;
        foreach (i, row; mat) {
            foreach (z, tek; row) {
              //  writeln(tek);
                mat[i][z] = z;
            }
        }
    }

Reply via email to