![]() |
data structure using c++
Can anyone help me with this? pleaseeeeeeeeeeeee
I really need help with this program: data structure using c++: All sequence containers have some common member functions. The list container provides some additional functions such as: push_front, pop_front, remove, remove_if, reverse, sort among others. Write an App that uses the STL list container to store the strings: "Hammer", "Screw driver", "Copper Pipe", and "Ladder". Then add to the front of the list the string "Bulbs" and to the end of the list the strings "Wrench" and "Ladder". Display the list. Sort the list by calling the sort function. To use the sort function you have to include the <algorithm> header file. Call the unique() function on the list to delete consecutive elements. Display the list. |
Re: data structure using c++
Code:
/* |
Re: data structure using c++
Hi,
can you explain this line code please from the program above stl container: ([](const string& left, const string& right)->bool{ if(left.compare(right) == 0) return true; else return false; }); I have commented this code and just use "myStrList.sort(); it runs just fine thanks, |
| All times are GMT +5.5. The time now is 09:12. |