编译出错
E:\c++\MSDev98\MyProjects\longest word\longest word.cpp(32) : error C2664: 'zimu' : cannot convert parameter 1 from 'char' to 'char []'E:\c++\MSDev98\MyProjects\longest word\longest word.cpp(31) : warning C4018: '<' : signed/unsigned mismatch
#include<stdio.h>
#include<string.h>
int place=0,point,length=0;
int i=0;
void main()
{
int zimu(char s[]);
int longest(char s[]);
char s[100];
gets(s);
longest(s);
for(i=place;i<length;i++)
printf("%c",s[i]);
}
int zimu(char c[100])
{
if(c[i]>='a'&&c[i]<='z'||c[i]>='A'&&c[i]<='Z')
return(1);
else return(0);
}
int longest(char s[100])
{
int len=0,point,flag=1;
for(i=0;i<strlen(s);i++)
{ if(zimu(s[i]))
if(flag)
{
point=i;
flag=0;
}
else len++;
else
{
flag=1;
if(len>length)
{
length=len;
place=point;
len=0;
}
}
}
return(place);
附:c语言中实参数组元素可以向形参数组元素传值吗?亟待回答,谢谢