Compare commits
2 Commits
0ed1982329
...
fddf7ab780
Author | SHA1 | Date | |
---|---|---|---|
fddf7ab780 | |||
ab4e7a7edb |
@ -72,14 +72,14 @@ int main(int argc, char *argv[])
|
|||||||
rewind(file);
|
rewind(file);
|
||||||
|
|
||||||
for (uint i = 0; i < lines; i++) {
|
for (uint i = 0; i < lines; i++) {
|
||||||
char *buffer = NULL;
|
|
||||||
size_t bufferSize = 0;
|
|
||||||
if (getline(&buffer, &bufferSize, file) == -1)
|
if (getline(&buffer, &bufferSize, file) == -1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
sscanf(buffer, "%d %d", &array1[i], &array2[i]);
|
sscanf(buffer, "%d %d", &array1[i], &array2[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(buffer);
|
||||||
|
bufferSize = 0;
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
qsort(array1, lines, sizeof(int), compareInt);
|
qsort(array1, lines, sizeof(int), compareInt);
|
||||||
|
@ -4,9 +4,10 @@ in
|
|||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
# Choose the build tools that you need
|
# Choose the build tools that you need
|
||||||
|
cmake
|
||||||
gcc
|
gcc
|
||||||
gdb
|
gdb
|
||||||
cmake
|
valgrind
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user