Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- #include <string.h>
- #include <ctype.h>
- bool precedence(char word1[46], char word2[46])
- {
- int i = 0;
- while (word1[i] != '\0')
- {
- if ((int)tolower(word1[i]) == (int)tolower(word2[i]))
- {
- i++;
- // if strlen of word2 shorter than word1
- if (word2[i] == '\0')
- return false;
- }
- else if ((int)tolower(word1[i]) < (int)tolower(word2[i]))
- {
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement