Advertisement
Guest User

Untitled

a guest
May 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. void sort(char **list, size_t listsize) {
  2. int i;
  3. int i2 = listsize-1;
  4. char *listMemory;
  5. // TODO Implementierung
  6. for (i = 0; i < listsize; i++) {
  7. if (list[i] != NULL) {
  8. for (; i2 > 0; i2--) {
  9. if (strcmp(list[i], list[i2]) > 0) {
  10. listMemory = list[i2];
  11. list[i2] = list[i];
  12. list[i] = listMemory;
  13. }
  14. }
  15. }
  16. else {
  17. list[i] = list[listsize - 1];
  18. list[listsize - 1] = NULL;
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement