int StrSub ( char *t, char *s, int i, int len ) /* 用t 返回串s 中第个i 字符开始的长度为len 的子串1≤i≤串长*/ { int slen; slen=StrLength ( s ); if ( i<1 || i>slen || len<0 || len>slen-i+1 ) { printf ( "参数不对" ); return 0; } for ( j=0; j<len; j++ ) t[j]=s[i+j-1]; t[j]=’\0’; return 1; }