I want to sort the array items using the vector.

int buff[4] = {15, 6, 55, 34};

std::vector<int> myVector(buff, buff+4);

now i will pass the array in to sort the buff data in ascending order.


How to do this ?
Kindly suggest.

void mySort(myVector.begin(),myVector.end())
   //Logic inside here

Actually i don't have an option to include the <algorithm> library.
I want to do the same functionality as sort() does in mySort() function.

As im new in this, please suggest something (logic) to execute inside the mySort() function.

Thanks well in Adwance.

This article has been dead for over six months. Start a new discussion instead.