newbie question

bearophile bearophileHUGS at lycos.com
Sun Sep 18 16:30:34 PDT 2011


Timon Gehr:

> As to 
> source-level compatibility, the only "guarantee" that Ds design gives is 
> that C code will either compile as D code with identical semantics or 
> not compile at all.

In practice there are few differences, try to compile this in C and D, swapping the import/include:

import core.stdc.stdio;
//#include "stdio.h"
float a[1];
void foo(float v[1]) {
    v[0]++;
}
int main() {
    foo(a);
    printf("%f\n", a[0]);
    return 0;
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list