C语言 指针如何给 char 字符串赋值,我代码错哪里怎么改?谢谢
#include<stdio.h>typedef struct student
{
char stuName[20];
float stuScord;
}Student;
void stuP( Student *p);
int main(int argc , char const * argv[])
{
Student stu = {0};
stuP (&stu);
printf("%s 的分数是:%.1f\n",stu.stuName, stu.stuScord);
return 0;
}
void stuP( Student *p)
{
p->stuName = "张三";
p->stuScord = 99.5;
}