sort.c
/*
 * Check the array is sorted, exit (1) if not
 */
Check the array is sorted, exit (1) if not
Check the array is sorted exit ( 1 ) if not
void checkSorted(ELEMENT *array, int size, const char *type, const char *msg) {
  int i;
  for (i = 1; i < size; i++) {
    if (array[i-1] > array[i]) {
      fail("%s: failed on test '%s'", type, msg);
      exit(1);
    }
  }
}
void checkSorted ( ELEMENT * array , int size , const char * type , const char * msg ) { int i ; for ( i = 1 ; i < size ; i ++ ) { if ( array [ i - 1 ] > array [ i ] ) { fail ( " " , type , msg ) ; exit ( 1 ) ; } } }
Check the array is sorted, exit (1) if not
Check the array is sorted exit ( 1 ) if not