If I have a class:
class A
{
private:
char z;
int x;
public:
A(char inputz, int inputx);
~A() {}
}
I want to make an array of A in class B.
class B
{
private:
A arrayofa[26];
public:
B();
~B() {}
void updatearray(); // This will fill the array with what is needed.
}
class B
{
B:B()
{
updatearray();
std::sort( &arrayofa[0], &arrayofa[26], A::descend );
}
}
How do I explicitly initialize arrayofa in the constructor of B?
A::descend? The normal way to sort things in descending order is to define the normal comparison operators for the class, and then usestd::greater.