Skip to content

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

@mikelhm

Description

@mikelhm

/* 兴趣 */

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

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions