Hi,
Can anyone find a solution for this???
I want to insert some values to a buffer. But at the same time i need to get that buffer in sorted order. ie,
If i insert 10, buffer should look like this 10
If i insert 20, buffer should look like this 10, 20
If i insert 5, buffer should look like this 5,10, 20
If i insert 15, buffer should look like this 5,10,15,20
If i insert 50, buffer should look like this 5,10,15,2,50
That is, after inserting all elements, i need to get a sorted buffer.
Now I am using a vector to push back the elements, copies all elements to a int* buffer and then sort that int* buffer using qsort function of C++.
Thanks in advance