I have tried to code bubble sort as my sort function, but when I run find it no longer exits when using ctrl d and just gives me a blank terminal line. My code is below, i'd be grateful if someone can help.
void sort(int values[], int n) { int counter = 0 ; char temp ; do { for (int i = 0; i < n; i++) {if (values[i] > values [i+1]) {temp = values [i] ; values [i] = values [i+1] ; values [i+1] = temp ; counter++ ; } } } while (counter > 0) ; // TODO: implement an O(n^2) sorting algorithm return; }