Relative Content

Tag Archive for clinuxwindowsgccvisual-c++

How can I declare a pointer to a constant struct litteral that uses a flexable array in C if possible?

So I wanted to store some constant text and data for parts of a level in a game in a struct, then put pointers for all those structs in a struct for each level, and pointers for all the level structs into a struct for the game. This appears to work if I use variable names for each of the nested data structures. However this is rather cumbersome as, I am likely to change all of the data and rearrange all of the levels as I am developing it, so I wanted to do it without needing variable names for each level and parts of the level. I learned that you can use pointers to literals however this appears to not work when the struct you are declaring has a flexible array.