0

I want to sort the array items using the vector.

Example:
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.

mySort(myVector.begin(),myVector.end());

How to do this ?
Kindly suggest.

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by mike_2000_17
0
void mySort(myVector.begin(),myVector.end())
{
   //Logic inside here
   ...
   ...
   ?
}
0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.