Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. int isafter(char char1, char char2)
  2. {
  3. if(char1 == char2){return 0;}
  4. if(char1<char2){return -1;}
  5. if(char1>char2){return 1;}
  6. }
  7.  
  8.  
  9. int isBefore(char* s1, char* s2){
  10. int i=0;
  11. while(s1[i] != '\0' && s2[i] != '\0')
  12. {
  13. if(isafter(s1[i],s2[i]==-1))
  14. {
  15. return 1;
  16. }
  17. if(isafter(s1[i],s2[i]==1))
  18. {
  19. return 0;
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement