Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ctype.h>
- int
- mystrspccmp(const char *str1, const char *str2)
- {
- while (isspace(*str1) || isspace(*str2) || (*str1 != 0 && *str2 != 0)) {
- while (isspace(*str1)) {
- ++str1;
- }
- while (isspace(*str2)) {
- ++str2;
- }
- if (*str1 != 0 && *str2 != 0 && *str1 == *str2) {
- ++str1;
- ++str2;
- } else {
- break;
- }
- }
- return (unsigned char) *str1 - (unsigned char) *str2;
- }
Advertisement
Add Comment
Please, Sign In to add comment