Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *devide(char *str,char ch)
- {
- int index=0;
- char *strpos=str;
- int len=strlen(str);
- char* newStr;
- while(*strpos!='\0')
- {
- if(*strpos!=ch)
- index++;
- else
- break;
- strpos+=1;
- }
- if(len==index)
- printf("%c was not found in string",ch);
- newStr=(char*)malloc((strlen(strpos))*sizeof(char));
- if(!newStr)
- return NULL;
- strcpy(newStr,strpos);
- return newStr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement