Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int string_index(char *a, char *b) {
- int i = 0;
- while (*a && *b) {
- a++; b++; i++;
- }
- return i;
- }
- int main(void) {
- char a[] = "楽しいです";
- char b[] = "楽しいですね";
- int i = string_index(a, b);
- int j;
- printf("match: %d\n", i);
- for (j = 0; j < i; j++) putchar(a[j]); puts("");
- for (j = 0; j < i; j++) putchar(b[j]); puts("");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement