Re: [Dev-C++] Function to order elements
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Alfred P. R. <al...@ya...> - 2005-04-25 04:09:37
|
Hi Alexsandro, If you place the numbers into a list then they will sort with the sort member function. #include <list> ... std::list <int> a_list; ... a_list.push_back(integer_number); ... a_list.sort(); Vector also has this capability. You may have to create a predicate function if you are tring to sort on an element of a structure that is in the list delcaration. The links go to the MSDN pages for the given members. Hopefully that helps somewhat! Alexsandro Meireles <mei...@gm...> wrote: Hi, all! Does anyone know any function to order elements? What I need is to pick up a list of numbers like: 1 232 44 5 5 45 5 45 545 and get an ordered list like 1 5 5 5 44 45 45 232 545, i.e., from the minimum value to the maximum value. Thanks in advance! -- Alexsandro Meireles Alfred P. Reaud |