字符串:设计在顺序存储结构上实现求子串算法。
void substring(char s[ ], long start, long count, char t[ ])
{
long i,j,length=strlen(s);
if (start<1 || start>length)
printf("The copy position is wrong");
else if (start+count-1>length)
printf("Too characters to be copied");
else{
for(i=start-1,j=0; i<start+count-1;i++,j++)
t[j]=s[i];
t[j]= '\0';
}
}