Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //String find substring (till NULL)
- char *mf_strstr(char *str, char *substr)
- {
- char *start1 = str;
- char *pos1 = str;
- char *pos2 = substr;
- while (*pos1 != 0)
- {
- while (*pos2 != 0)
- {
- if ((*pos1++ == *pos2++) && (*pos2 == 0))
- {
- return pos1 - start1;
- }
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment