Answers for "c++ array of structure sorting"

C++
2

sort array c++

//me
int arr[6] = {3,1,4,0,5,2};
sort(arr, arr+6);

//arr is now {0,1,2,3,4,5}
Posted by: Guest on February-03-2022
2

how to sort array in c++

#include <algorithm>

int main(){
  int v[2000];
  std::sort(std::begin(v), std::end(v));
}
Posted by: Guest on October-15-2021

Browse Popular Code Answers by Language