error C2106: '=' : left operand must be l-value
求救error C2106: '=' : left operand must be l-value
nt i, m, n,f[100]={0};
int numterm ;
numterm = a+b;
int h=0;
ArcNode *p;
for(h=0;h<b;h++)
{ printf("请输入名字\n");
scanf("%s",&G->vertices[h].name);
printf("请输入学号\n");
scanf("%d",&G->vertices[h].classid);
else f[G->vertices[h].classid]=1;
printf("请输入年龄\n");
scanf("%d",&G->vertices[h].age);
G->vertices[h].indegree=G->vertices [h].state=-1;
G->vertices[h].firstarc=NULL;}
for(int d=0;h<numterm;h++)
{G->vertices[h].name=data[v[d]].name; ************
G->vertices[h].classid=data[v[d]].classid;
G->vertices[h].credit=data[v[d]].credit;
G->vertices[h].indegree=G->vertices [h].state=-1;
G->vertices[h].firstarc=NULL;d++;}
代码有点长,只打这些能看出哪里错吗,****是提示错误的地方
------解决思路----------------------
如果name是数组的话,应该这样:
strcpy(G->vertices[h].name, data[v[d]].name);
------解决思路----------------------
name成员变量是什么类型,估计是数组吧,
改成 strcpy( G->vertices[h].name, data[v[d]].name );
nt i, m, n,f[100]={0};
int numterm ;
numterm = a+b;
int h=0;
ArcNode *p;
for(h=0;h<b;h++)
{ printf("请输入名字\n");
scanf("%s",&G->vertices[h].name);
printf("请输入学号\n");
scanf("%d",&G->vertices[h].classid);
else f[G->vertices[h].classid]=1;
printf("请输入年龄\n");
scanf("%d",&G->vertices[h].age);
G->vertices[h].indegree=G->vertices [h].state=-1;
G->vertices[h].firstarc=NULL;}
for(int d=0;h<numterm;h++)
{G->vertices[h].name=data[v[d]].name; ************
G->vertices[h].classid=data[v[d]].classid;
G->vertices[h].credit=data[v[d]].credit;
G->vertices[h].indegree=G->vertices [h].state=-1;
G->vertices[h].firstarc=NULL;d++;}
代码有点长,只打这些能看出哪里错吗,****是提示错误的地方
------解决思路----------------------
如果name是数组的话,应该这样:
strcpy(G->vertices[h].name, data[v[d]].name);
------解决思路----------------------
name成员变量是什么类型,估计是数组吧,
改成 strcpy( G->vertices[h].name, data[v[d]].name );