Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sort(char **list, size_t listsize) {
- int i;
- int i2 = listsize-1;
- char *listMemory;
- // TODO Implementierung
- for (i = 0; i < listsize; i++) {
- if (list[i] != NULL) {
- for (; i2 > 0; i2--) {
- if (strcmp(list[i], list[i2]) > 0) {
- listMemory = list[i2];
- list[i2] = list[i];
- list[i] = listMemory;
- }
- }
- }
- else {
- list[i] = list[listsize - 1];
- list[listsize - 1] = NULL;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement