fork download
  1.  
  2. int fast_sort (int *a, int left, int right)
  3. {
  4. int i = left, j = right;
  5. int middle = a[(left+right) / 2];
  6.  
  7. while (i < middle && a[i] < middle) i++;
  8. while (j > left && a[j] > middle) j--;
  9.  
  10. if (i <= j) {
  11. swap (&a[i], &a[j]);
  12. ++i;
  13. --j;
  14. }
  15.  
  16. if (i < right)
  17. fast_sort (a, i, right);
  18. if (j > left)
  19. fast_sort (a, left, j);
  20.  
  21. return 0;
  22. }
  23.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'fast_sort':
prog.c:11:11: warning: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
           swap (&a[i], &a[j]);
           ^
/usr/lib/gcc/i586-linux-gnu/5/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/home/HemrJI/cctMMI6G.o: In function `fast_sort':
prog.c:(.text+0xb6): undefined reference to `swap'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty