Hi guys, I have a problem, I wanted to sort the numbers of ingredients.
I tried several methods but have not reached a result. I've searched on the internet, I found an example, but I don't know how to make with "greater" like this "http://www.java2s.com/Tutorial/Cpp/0340__list/sortlistwithuserdefinedobjectswithgreater.htm" I don't get it... If someone can explain me with an easy path or method.
I want to do both, but first I want to do sorting of ingredients .
When you said an overloaded parenthesis operator you speak about that:
bool operator()( Milkshake &a)
{
return(ingredients>a.ingredients;
}
I tried something but doesn't work.