| |
| Posted by Dan Liebgold in reply to Dan Liebgold | PermalinkReply |
|
Dan Liebgold
Posted in reply to Dan Liebgold
|
Of course, this seems to work:
static NODE nodetbl[3] =
[
{0,(NODE*)nodetbl + 1},
{0,(NODE*)nodetbl + 2},
{0,null}
];
It does seem odd that ((NODE*)nodetbl + 1) is constant, but &nodetbl[1] is not.
Dan
In article <b2v4b4$1nti$1@digitaldaemon.com>, Dan Liebgold says...
>
>
>In C/C++, I am used to building static data structures using pointers embedded in the initializers, like so:
>
>
>struct NODE {
>int data;
>NODE *next;
>}
>
>static NODE nodetbl[3] = [
>{0,&nodetbl[1]},
>{0,&nodetbl[2]},
>{0,null}
>];
>
>
|