|
发表于 2021-4-14 11:22:26
|
显示全部楼层
回帖奖励 +2 鱼币
本帖最后由 yuxijian2020 于 2021-4-14 11:28 编辑
因为你没有给player结构体中的门派赋值
最好是重新弄个方法用于给player对象赋值
- void InitPlayer(struct player* p, int id, char* name, char* pass, char sex, int mId, char* mName, char count, char type)
- {
- p->id = id;
- strcpy_s(p->name, sizeof(p->name) / sizeof(char), name);
- strcpy_s(p->pass, sizeof(p->pass) / sizeof(char), pass);
- p->sex = sex;
- p->martial.id = mId;
- strcpy_s(p->martial.name, sizeof(p->martial.name) / sizeof(char), mName);
- p->martial.count = count;
- p->martial.type = type;
- }
复制代码 |
|