view test/b.d @ 175:c44e6a711885 trunk

[svn r191] Fixed: array literals did not support all type/storage combinations. Fixed: with expression had broke somewhere along the way.
author lindquist
date Wed, 07 May 2008 00:01:13 +0200
parents 25d4fcce53f4
children d9d5d59873d8
line wrap: on
line source

module b;

struct S
{
    int i;
    float[4] f;
}

void main()
{
    S s;
    int i = s.i;
    int* p = &s.i;
    *p = 42;
    printf("%d == %d\n", *p, s.i);

    float* f = &s.f[0];
    printf("%f == %f\n", *f, s.f[0]);
    *f = 3.1415;
    printf("%f == %f\n", *f, s.f[0]);
    s.f[0] = 123.456;
    printf("%f == %f\n", *f, s.f[0]);
}