Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static inline char *substr(char *str, int start, int length) {
- char* res=NULL;
- int i=0;
- for(i=0;i<length;i++) {
- if(str[start+i]=='\0' || str[start+i]==NULL || !str[start+i]) res[i]=NULL;
- else res[i]=str[start+i];
- }
- res[length]=NULL;
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment