while(strcmp(b->w[15],w[15])<=0) 请问这个语句哪里错了??
来源:百度知道 编辑:UC知道 时间:2024/06/08 05:26:53
编译报错是error C2664: 'strcmp' : cannot convert parameter 1 from 'char' to 'const char *'
W*delate_list(W *head,char w[15])
{
W *a,*b;
a=head;
b=b->next;
while(strcmp(b->w[15],w[15])&&a!=NULL)
{
a=b;
b=b->next;
}
if(a!=NULL)
{
a->next=b->next;
delete b;
cout<<"have delete!"<<endl;
return 1;
}
else
{
cout<<"not zhe word!"endl;
return 0;
}
程序师这样的,b->w[15] 改为&b->w[15]还是不行
W*delate_list(W *head,char w[15])
{
W *a,*b;
a=head;
b=b->next;
while(strcmp(b->w[15],w[15])&&a!=NULL)
{
a=b;
b=b->next;
}
if(a!=NULL)
{
a->next=b->next;
delete b;
cout<<"have delete!"<<endl;
return 1;
}
else
{
cout<<"not zhe word!"endl;
return 0;
}
程序师这样的,b->w[15] 改为&b->w[15]还是不行
strcmp 参数1不能从const char*转换为char型
b->w[15] 改为&b->w[15]试试
不好意思啊,我刚才的回答没有测试
后面的也加个&这行的编译一定通过
while(strcmp(&b->w[15],&w[15])&&a!=NULL)
我已经测试过了
strcmp的两参数都得为地址 w是地址,w[15]就变量了,你保证两个都是地址决对可以
你这题里的b应该是一结构指针,其结构体中有数组成员
这东西是麻烦,希望能帮上你
我不会
测试strCmp函数
关于strcmp函数
strcmp的问题???
【he alwanys ___ the paper while he is eating breakfast. A reads B playing
A: Could you help me look after my baby while I'm away? B:( )
John fell asleep_________he was listening to the music. A while B when
We can speak_____animals can't.A when B for C since D while
while watching tv,___a.the doorbell rang b.we heard the doorbell ring c.we heard
浙江acm1001 a+b这道的while循环怎么理解?
The train had just started _____we arrive at the station.A while B when C af