已定义结构体,但要在写函数时在函数内需要输入一个新的结构体成员来实现查询,
没个函数都错在与结构体有关的地方,下面是报错。void search() /***查找函数***/
{
int i,n,k,w1=1,w2,w3;
struct Hotel s;
n=load();
do
{
w2=-1;
do
{
k=-1;
printf("\n\nEnter ID_card that you want to search! ID_card:");
scanf("%s",&s.Client_list.ID_card); /***输入需要查找的身份证号***/
for(i=0;i<n;i++)
if(strcmp(s.Client_list.ID_card,Room [i].Client_list.ID_card)==0) /***串比较函数,若表达式等于0,则两串相等***/
{
warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
C:\Program Files\Microsoft Visual Studio\MyProjects\program\pro.c(183) : warning C4024: 'strcmp' : different types for formal and actual parameter 1
C:\Program Files\Microsoft Visual Studio\MyProjects\program\pro.c(183) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
C:\Program Files\Microsoft Visual Studio\MyProjects\program\pro.c(183) : warning C4024: 'strcmp' : different types for formal and actual parameter 2
C:\Program Files\Microsoft Visual Studio\MyProjects\program\pro.c(209) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\program\pro.c(211) : error C2143: syntax error : missing ';' before 'type'
C:\Program Files\Microsoft Visual Studio\MyProjects\program\pro.c(316) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '
C:\Program Files\Microsoft Visual Studio\MyProjects\program\pro.c(316) : warning C4024: 'strcmp' : different types for formal and actual parameter 1
C:\Program Files\Microsoft Visual Studio\MyProjects\program\pro.c(316) : warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int '