substring

From , 4 Years ago, written in C, viewed 49 times.
URL https://pastebin.vip/view/3937230d
  1. int StrSub ( char *t, char *s, int i, int len )
  2. /* 用t 返回串s 中第个i 字符开始的长度为len 的子串1≤i≤串长*/
  3. {
  4.         int slen;
  5.         slen=StrLength ( s );
  6.         if ( i<1 || i>slen || len<0 || len>slen-i+1 )
  7.                 { printf ( "参数不对" ); return 0; }
  8.         for ( j=0; j<len; j++ )
  9.                 t[j]=s[i+j-1];
  10.         t[j]=’\0;
  11.         return 1;
  12. }
  13.  

Reply to "substring "

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website