After reading the other questions, I still don't get how to check it.
I tried to use gdb on ./find, but while I ran it, I could only see what was expected. Then, while typing n, it said "in fileops.c" forever.
Then, I tried using printf. I typed in printf ("%i\n", values[i]);
underneath the swap, and when I ran find, nothing happened.
Also, if you could, could you tell me if my code is off anywhere? That would be great!
void sort(int values[], int n)
{
int compare = 0;
if (n <= 1) return;
for (int i = 0; i < n; i++)
{
for (compare = i + 1; compare < n; compare++)
{
if (values[i] > values[compare])
{
i = compare;
}
}
int temp = values[i];
values[i] = values[compare];
values[compare] = temp;
}
}