Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. void sort_entries(char **entries, int reverse)
  2. {
  3. char **next;
  4. char **previous;
  5. char *t;
  6. int value;
  7.  
  8. previous = tab;
  9. while (*(next = previous + 1))
  10. {
  11. value = strcasecmp(*previous, *next);
  12. if ((!reverse && value > 0)
  13. || (reverse && value < 0))
  14. {
  15. t = *previous;
  16. *previous = *next;
  17. *next = t;
  18. previous = entries;
  19. continue ;
  20. }
  21. previous++;
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement