Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int find_substr(char *str, char *substr, int number_pos)
- {
- for (number_pos, j = 0; str[number_pos] != '\0'; number_pos++, j = 0) {
- for (; substr[j] != '\0'; j++) {
- if (str[number_pos + j] != substr[j])
- {
- j = -1;
- break;
- }
- if (j != -1) return number_pos;
- }
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement