Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- const int size = 20;
- char str1[size] = "avadakedavra";
- char str2[size] = "abvdea";
- printf("number:%d", str_cmp( str1, str2));
- }
- int str_cmp(char* str1, char* str2)
- {
- int i = 0;
- int j = 0;
- int count = 0;
- while (str1[i])
- {
- /*while (str2[j])
- {*/
- if (str1[i] - str2[j] == 0)
- {
- count++;
- i++;
- j = 0;
- }
- else
- {
- if (str2[j + 1])
- {
- j++;
- }
- else
- { i++;
- j = 0;
- }
- }
- /*if (str1[i] && str2[j] && delta = 0)
- {
- str1[i] - str2[j] = 0;
- count++;
- }*/
- /*}*/
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement