Compile time static array issues.

bearophile bearophileHUGS at lycos.com
Sat May 28 18:56:06 PDT 2011


Era Scarecrow:

>  I don't seem to have a good explanation why this isn't working.

Also try:

struct Joined {
    string name, partof, preReq;
}

struct SubrecordParts {
    string name;
    int size;
    string[] notes;
    int identifyBy;
    int[] partSize;
}

Joined[] attached = [
    {"MAST", "DATA", "TES3"},
    {"ANAM","INTV",  "FACT"}
];

SubrecordParts[] parts = [
    {"AADT", 16, ["fWeight", "iValue", "iUses", "fQuality"],
     -1, [4,4,4,4]},
    {"AODT", 24, ["iType", "fWeight", "iValue", "iHealth",
     "iEnchant Points", "iArmour"], -1, [4,4,4,4,4,4]}
];

void main() {}

In D struct names are (usually) CamelCase.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list