Get list of C structure members

前端 未结 6 1790
盖世英雄少女心
盖世英雄少女心 2020-12-09 18:07

Is it possible to get the list of members of a structure as a char ** ?

For example, something like this:

struct mystruct {
    int x;
          


        
6条回答
  •  不知归路
    2020-12-09 19:05

    Qt scans the .h files and generated .cpp with function returning such code.

    You can also achieve this with a bunch of macros, but you need to write them by hand for each types

提交回复
热议问题