这个帖子不算,别看了,我学学发帖。
#include<stdio.h>#include<stdlib.h>
int index( char str1[], char str2[], int pos )
——{ //此处提醒。——conflicting types for built-in fuction 'index'.
int j=1;
int i=pos;
while( i<=str1 || j<=str2 )
{
if( str1 == str2 )
{
i++;
j++;
}
else
{
i = i-j+2;
j = 1;
}
}
if( j > str2 )
{
return i-str2;
}
else
{
return 0;
}
}
int main()
{
inta, pos=1;
char str1 =" ilovefishc.com";
char str2 =" fishc";
str1 = 14;
str2 = 5;
a=index( str1, str2, pos );
printf("The location of the start equal:");
printf("%d\n",a);
return 0;
}
我发个看看。:sad #include<stdio.h>
#include<stdlib.h>
int index( char str1[], char str2[], int pos )
——{ //此处提醒。——conflicting types for built-in fuction 'index'.
int j=1;
int i=pos;
while( i<=str1 || j<=str2 )
{
if( str1 == str2 )
{
i++;
j++;
}
else
{
i = i-j+2;
j = 1;
}
}
if( j > str2 )
{
return i-str2;
}
else
{
return 0;
}
}
int main()
{
inta, pos=1;
char str1 =" ilovefishc.com";
char str2 =" fishc";
str1 = 14;
str2 = 5;
a=index( str1, str2, pos );
printf("The location of the start equal:");
printf("%d\n",a);
return 0;
}
看看这个能发吗? {:9_240:}那我是不是可以删帖了 康小泡 发表于 2015-11-17 19:21
那我是不是可以删帖了
别啊,姐,我正好有个问题,就是上面那个函数,我发了悬赏,帮我看看呗。 浮云骑士 发表于 2015-11-17 19:34
别啊,姐,我正好有个问题,就是上面那个函数,我发了悬赏,帮我看看呗。
哪个函数? 康小泡 发表于 2015-11-17 19:50
哪个函数?
字符串排序中的BF算法,看小甲鱼的视频学的。
http://bbs.fishc.com/thread-66317-1-1.html
(出处: 鱼C论坛)
康小泡 发表于 2015-11-17 19:50
哪个函数?
悬赏互助中的:BF算法那个。字符串排序中的BF算法,看小甲鱼的视频学的。 http://bbs.fishc.com/thread-66317-1-1.html (出处: 鱼C论坛)这是链接。
大神帮帮忙。 康小泡 发表于 2015-11-17 19:50
哪个函数?
悬赏互助中的:“字符串排序中的BF算法,看小甲鱼的视频学的”。大神 帮忙看看。 康小泡 发表于 2015-11-17 19:50
哪个函数?
我上面就一个函数,有一个提醒,我标出来了,大神看看。 康小泡 发表于 2015-11-17 19:50
哪个函数?
#include<stdio.h>
#include<stdlib.h>
int index( char str1[], char str2[], int pos )
{ //此处提醒。——conflicting types for built-in fuction 'index'.
int j=1;
int i=pos;
while( i<=str1 || j<=str2 )
{
if( str1 == str2 )
{
i++;
j++;
}
else
{
i = i-j+2;
j = 1;
}
}
if( j > str2 )
{
return i-str2;
}
else
{
return 0;
}
}
int main()
{
inta, pos=1;
char str1 =" ilovefishc.com";
char str2 =" fishc";
str1 = 14;
str2 = 5;
a=index( str1, str2, pos );
printf("The location of the start equal:");
printf("%d\n",a);
return 0;
}
帮帮忙了。 感谢分享
就是来顶 支持 我就是来赚个鱼 币
页:
[1]