I\'m pretty sure this will end up being a really obvious question, and that\'s why I haven\'t found much information on it. Still, I thought it was worth asking :)
B
Another theoretical possibility would be to compile some code at run-time using a compiler library such as libtcc.
While very appealing in theory (it does sound like a self-modifying application – your application would only have to generate C code for your struct and insert it in a template, then ask libtcc to compile it and then call some functions defined in your template to use that struct), this solution will probably not work great in practice. Why ? Well, as of 2016, libtcc (and the whole tcc project) is not very actively developed and there are issues with architectures such as x86_64.