This requires no initialization code to run; linking resolves it.
Very long ago I made a GUI help system for a program, where all the documentation nodes were represented as structures with pointers for their navigation links: next section, previous section, up, children ...
I statically declared the entire content with declarations akin to the above circular_list.
The help GUI was just a window which displayed the node contents, and the buttons like next and prev just chased the pointers to another node which would replace the displayed content.
Worked like a charm.
Good luck giving that to internationalization people to translate. Haha!
Very long ago I made a GUI help system for a program, where all the documentation nodes were represented as structures with pointers for their navigation links: next section, previous section, up, children ...
I statically declared the entire content with declarations akin to the above circular_list.
The help GUI was just a window which displayed the node contents, and the buttons like next and prev just chased the pointers to another node which would replace the displayed content.
Worked like a charm.
Good luck giving that to internationalization people to translate. Haha!