Guest User

substr()

a guest
Mar 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. static inline char *substr(char *str, int start, int length) {
  2.     char* res=NULL;
  3.     int i=0;
  4.     for(i=0;i<length;i++) {
  5.         if(str[start+i]=='\0' || str[start+i]==NULL || !str[start+i]) res[i]=NULL;
  6.         else res[i]=str[start+i];
  7.     }
  8.     res[length]=NULL;
  9.     return res;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment