Go Down

Topic: Forward declarations of const struct arrays (Read 2075 times) previous topic - next topic

oboud


Quote
So you agree that at least one extern is required.


It is if you want a forward declaration of a const.

If you have two declared structs whose members point to one another it seems as though it is more than a matter of preference.


I have no idea what you mean.

Code: [Select]

typedef struct foo{
    byte *bar;         //bar is a pointer to byte
    int anotherElementInAFoo;
};

const FooUser[] = {
    {(foo *)oof,42}  //not allowed
};


As opposed to
Code: [Select]

char foo = 'x';
char * bar = &foo;
int ASCIIofFoo = (int *)bar;  //okaly-dokely



Go Up