fseek(in, 0L, SEEK_SET);
// struct Array with Dateienanzahl
- struct file_size *fs = NULL;
- fs = (struct file_size *)malloc((lines - 1) * sizeof(struct file_size));
+ struct file_size fs[lines -1];
lines = 0;
while(fscanf(in, "%[^\n]\n", pfad) == 1) {
}
}
- fs = (struct file_size *)realloc(fs,
- (lines + 1) * sizeof(struct file_size));
-
// sortiere das array fs mit stucts
qsort(fs, lines, sizeof(struct file_size), cmpfunc);