fork download
  1. #include <algorithm>
  2. #define SIZE (1000)
  3.  
  4. struct S {
  5. int *vect;
  6. };
  7.  
  8. int main() {
  9.  
  10. struct S* s = static_cast<struct S*>(malloc(sizeof(struct S)));
  11.  
  12. s->vect = static_cast<int*>(malloc(sizeof(int) * SIZE));
  13.  
  14. for(int i = 0; i < SIZE; i++) {
  15. s->vect[i] = i;
  16. }
  17.  
  18. std::sort(s->vect, s->vect + SIZE);
  19.  
  20. }
Success #stdin #stdout 0s 4180KB
stdin
Standard input is empty
stdout
Standard output is empty