view tests/code/basic_types_2.d @ 161:0e10479623f6

Changed the tests for static arrays a little The following code IS legal: int[10] a; int[10] b = a; It's only assignment outside of init thats illegal Also a test for a[] = b, which should compile to a memcpy
author Anders Halager <halager@gmail.com>
date Tue, 22 Jul 2008 13:39:15 +0200
parents 381975d76baf
children
line wrap: on
line source

int main()
{
    byte a = 2;
    short b = 3 * a;
    int c = b + a;
    long d = c * a / b;

    d = itol(2);
    d = itol(a);
    d = itol(b);
    d = itol(c);

    c = stoi(a);
    c = stoi(b);

    return 3;
}

long itol(int x) { return x; }
int stoi(short x) { return x; }