如何给结构体字符串数组赋值。为什么老出错,而且就是出在s.name赋值那里
#include<stdio.h>structstudent{intyear;charname[8];}s;main(){s.year=10;s.name="wsdssd...
#include <stdio.h>
struct student
{
int year;
char name[8];
}s;
main()
{
s . year = 10;
s . name= "wsdssds";
printf("%d%s",s.year,s.name);
} 展开
struct student
{
int year;
char name[8];
}s;
main()
{
s . year = 10;
s . name= "wsdssds";
printf("%d%s",s.year,s.name);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询