64,636
社区成员
发帖
与我相关
我的任务
分享
#include <string.h>
struct student
{
char name[20];
char codeForStudent[20];
char studentId[11];
char classes[20];
};
struct student stu[30];
void initStudent(struct student *pStu, const char *pName, const char *pCode, const char *pId, const char *pClass)
{
strcpy(pStu->name, pName);
strcpy(pStu->codeForStudent, pCode);
strcpy(pStu->studentId, pId);
strcpy(pStu->classes, pClass);
}
int main()
{
initStudent(&stu[0], "AbcDefg", "iloveit", "1234567890", "0"); // 这一行错误,错误类型见上文
}