Pages: 1 [2]   Go Down
Author Topic: Forward declarations of const struct arrays  (Read 1452 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
typedef struct foo{
    byte *bar;         //bar is a pointer to byte
    int anotherElementInAFoo;
};

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

As opposed to
Code:
char foo = 'x';
char * bar = &foo;
int ASCIIofFoo = (int *)bar;  //okaly-dokely

Logged

Pages: 1 [2]   Go Up
Jump to: