串的实现
#include <iostream >using namespace std;
#define CHUNKSIZE 80;
typedef struct Chunk
{
char ch[CHUNKSIZE];
struct Chunk *next;
}Chunk;
typedef struct
{
Chunk *head,*tail;
int curlen;
}LString ;
int gets()
{
char c[10]={'a','b','c','e','d','a','f','c','d','m'};
for(int i=0;i<10;i++)
cout <<'a[i]';
}
int Index(LString S,LString T,int pos)
{
int i;int j;
i=pos;j=1;
while(i<= S[0]&&j<=T[0])
{
if(j==0||S[i]==T[i]
{i++;
j++;
}
else j=next[j];
}
if(j>T[0])
return i-T[0];
else
return 0;
}
void get_next(SString T,int next[])
{
int i=1;
next[1]=0;
j=0;
while(i<T[0])
{
if(j==0||T[i]==T[j])
{
++i;++j;next[i]=j;
}
else j=next[j];
}
请各位大侠指点这个程序里哪儿有错误