Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- int mystrspccmp(const char *str1, const char *str2) {
- const char *s1 = str1, *s2 = str2;
- while (isspace (*s1)) {
- ++s1;
- }
- while (isspace (*s2)) {
- ++s2;
- }
- while (*s1 == *s2 && *s1) {
- ++s1;
- ++s2;
- while (isspace (*s1)) {
- ++s1;
- }
- while (isspace (*s2)) {
- ++s2;
- }
- }
- return (unsigned)*s1 - (unsigned)*s2;
- }
- int
- main(void) {
- char *s = "ubuijb", *t = "d";
- printf("%d", mystrspccmp(s, t));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement