>>475
エラーチェックとかほとんどしてないが。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int compare(const void *s1, const void *s2) {
    return strcmp(*(char **)s1, *(char **)s2);
}

int main() {
    char *lines[10], buf[100];
    int i = 0, j;
    FILE *fp = fopen("sort.txt", "r");
    while (fgets(buf, 10, fp) != NULL) {
        lines[i] = strdup(buf);
        ++ i;
    }
    fclose(fp);
    qsort(lines, i, sizeof(char *), compare);
    for (j = 0; j < i; j++) {
        printf("%s", lines[j]);
    }
}