Go Down

Topic: Forward declarations of const struct arrays (Read 2648 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy