To help my one-year search for filling SO with D (= p) questions, I ran into another problem; initializing an array of structures globally. Note:
struct A
{
int a;
float b;
}
A[2] as;
as[0] = {0, 0.0f};
as[1] = {5, 5.2f};
void main() {}
Results in:
$ dmd wtf.d
wtf.d(8): no identifier for declarator as[0]
wtf.d(9): no identifier for declarator as[1]
Looking through the documents in Digital Mars , I do not see anything completely obvious to me, so I will again turn to the brave inhabitants! I assume that the error message does not have much to do with the real problem, since, of course, [0] is an identifier (but dmdconsiders it a declarator that AFAICT looks through docs , is that not ??
source
share