急急急!!求帮助啊!!
#include "stdio.h"#include "conio.h"
#include"string.h"
#define MAXSIZE 100
typedef struct
{
char str[MAXSIZE];
int length;
}seqstring;
int i,result;
seqstring *s,*s1,*s2;
seqstring *creatstring(seqstring *s)
{
int i=0;char ch;
while((ch=getchar())!='\0')
{
s->str[i]=ch;
i++;
}
return s;
}
int comparestr(seqstring *s1,seqstring *s2)
{
int i,len;
if(s1->length<s2->length)
len=s1->length;
else len=s2->length;
while(i<len)
{
if(s1->str[i]>s2->str[i])
return (result=1);
else if(s1->str[i]<s2->str[i]) return (result=-1);
else
s1->str[i]=s2->str[i]; return(result=0);
i++;
}
}
void main()
{
printf("初始化字符串s1");
creatstring(s1);
printf("初始化字符串s2");
creatstring(s2);
comparestr(s1,s2);
printf("result=%d",result);
return 0;
}用数据结构中的传5实现两个字符串的比较 编译的时候没问题 可咋运行不出结果 在win tc下运行的