fork download
  1. #include <stdio.h>
  2. #include <cstdlib>
  3. #include <algorithm>
  4.  
  5. class Foo
  6. {
  7. public:
  8. int var1, var2;
  9. unsigned char* sth;
  10. };
  11.  
  12. class SomeClass
  13. {
  14. public:
  15. Foo** table;
  16. int tableSize;
  17.  
  18. void QuickSort();
  19. };
  20.  
  21. int compare(const void *A, const void *B)
  22. {
  23. return ((*(Foo*)B).var2 - (*(Foo*)A).var2);
  24. };
  25.  
  26. void SomeClass::QuickSort()
  27. {
  28. qsort(table,tableSize,sizeof(&table[0]),compare);
  29. };
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty