Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

结构体的成员是 结构体数组 如何转换 #12

Open
mikelhm opened this issue Sep 6, 2020 · 3 comments
Open

结构体的成员是 结构体数组 如何转换 #12

mikelhm opened this issue Sep 6, 2020 · 3 comments

Comments

@mikelhm
Copy link

mikelhm commented Sep 6, 2020

/* 兴趣 */

举个例子,如 一个学生有多个兴趣, 兴趣也是一个结构体。这种场景如何转换。

typedef struct {
char name;
int rank;
} Interest

/* 籍贯 */
typedef struct {
char name[16];
} Hometown;

/* 学生 */
typedef struct {
uint8_t id;
uint8_t score[8];
char name[10];
double weight;
Hometown hometown;
Interest interest[10]
} Student;

@armink
Copy link
Owner

armink commented Sep 7, 2020

暂不支持结构体数组

@yuxuebao
Copy link
Contributor

参考下面的分支,已经实现结构体和数组的转换,并提供自动生成转换代码的脚本:)
https://github.com/yuxuebao/struct2json

@jiuxiaxixi
Copy link

参考下面的分支,已经实现结构体和数组的转换,并提供自动生成转换代码的脚本:) https://github.com/yuxuebao/struct2json

有例子么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants