0
Why is sorting a non-member function in classes while sorting an array of objects?
I'm having problem while sorting an array of objects in classes. It's a bit confusing. If someone can help me with examples, it would be really helpful.
2 Respostas
0
u can create an array object of the class you want to sort . Then , u can sort them the specific data member u you want to just like sorting an array .
u can create a friend function which can directly access private members ( if data members u want to sort are private ) .
0
好