Simple, I have a struct like this:
struct bla{
string name;
float depth;
}
I have an bla array, and I want to sort by depth, being the greatest depth first.
What should the delegate do/return? I cant find any concrete example.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the overload of
Array.Sortwhich takes aComparison<T>:On this way you sort the original array instead of creating new one.