view test/b.d @ 15:37a4fdab33fc trunk

[svn r19] * Added support for reassigning 'this' inside class constructors. * Added preliminary support for UnrolledLoopStatement. That is foreach on a tuple.
author lindquist
date Wed, 03 Oct 2007 04:56:32 +0200
parents c53b6e3fe49a
children fd32135dca3e
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]);
}