left operand must be l-value什么意思# include # define M 10typedef struct{ char num[10];int s;} SCORE;int fun(SCORE *a,SCORE *b){int i,j=0;b[0].s=a[0].s;for(i=1;i
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/25 04:46:53
![left operand must be l-value什么意思# include # define M 10typedef struct{ char num[10];int s;} SCORE;int fun(SCORE *a,SCORE *b){int i,j=0;b[0].s=a[0].s;for(i=1;i](/uploads/image/z/11590970-50-0.jpg?t=left+operand+must+be+l-value%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%23+include+%23+define+M+10typedef+struct%7B+char+num%5B10%5D%3Bint+s%3B%7D+SCORE%3Bint+fun%28SCORE+%2Aa%2CSCORE+%2Ab%29%7Bint+i%2Cj%3D0%3Bb%5B0%5D.s%3Da%5B0%5D.s%3Bfor%28i%3D1%3Bi)
left operand must be l-value什么意思# include # define M 10typedef struct{ char num[10];int s;} SCORE;int fun(SCORE *a,SCORE *b){int i,j=0;b[0].s=a[0].s;for(i=1;i
left operand must be l-value什么意思
# include
# define M 10
typedef struct
{
char num[10];
int s;
} SCORE;
int fun(SCORE *a,SCORE *b)
{
int i,j=0;
b[0].s=a[0].s;
for(i=1;i
left operand must be l-value什么意思# include # define M 10typedef struct{ char num[10];int s;} SCORE;int fun(SCORE *a,SCORE *b){int i,j=0;b[0].s=a[0].s;for(i=1;i
left operand must be l-value是说:运算符的左边应该是一个“左值”.所谓“左值”就是指在程序中占用内存空间、可以被修改的量,比如各种变量.
你这条语句中的b[j].num是一个字符数组,而数组是不能整体赋值的.
如果你想把a[i].num赋给b[j].num,应该调用strcpy函数:strcpy(b[j].num,a[i].num);然后加入头文件#include .
strcpy是一个字符串操作函数.