有下面这段代码,是输入提取结构体中的数据,可是老提示 [Warning] passing arg 1 of `strcmp' makes pointer from integer without a cast 请哪位大虾帮忙
#include<stdio.h>
#include<string.h>
char line_name;
float line_A;
float line_d;
double line_Tp;
float line_G;
float line_E;
double line_alf;
/******** 导线参数表************/
struct pick
{ char name[12];
float line_A;
float line_d;
double line_Tp;
float line_G;
float line_E;
double line_alf;
}pick_lin[5]={{"GJ-35" ,37.15 ,7.8 ,45472,318.2,181423,11.5e-6},
{"GJ-50" ,49.46 ,9.0 ,53317.9,423.7,181423,11.5e-6},
{"LGJ-70/10" ,79.39 ,11.4 ,23390,275.2,79000 ,19.1e-6},
{"LGJ-70/40" ,110.40,13.60,58300,511.3,105000,15.3e-6},
};
/*导线选取函数 */
void fun_picklin(struct pick *p)
{
char ch;
int i,j;
printf("\n");
printf("/*------请输入计算导线型号(如GJ-50或LGJ-120/20): ");
scanf("%s",ch);
for(i=0,j=0;i<=30;i++)
{ if(strcmp(ch,p[i].name)==0)
{ line_name=ch;
line_A=p[i].line_A;
line_d=p[i].line_d;
line_Tp=p[i].line_Tp;
line_G=p[i].line_G;
line_E=p[i].line_E;
line_alf=p[i].line_alf;
j=1;
}
}
if(j==0) printf("\n没有找到你所输入的导线型号\n");
printf("%s,%f,%f,%f,%f,%f,%f",line_name,line_A,line_d,line_Tp,line_G,line_E,line_alf);
}
int main(void)
{ fun_picklin(pick_lin);
return 0;
}