Joe*_*man 6 c++ arrays data-structures
如果我有课:
class A
{
private:
char z;
int x;
public:
A(char inputz, int inputx);
~A() {}
}
Run Code Online (Sandbox Code Playgroud)
我想A在课堂上制作一个数组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 );
}
}
Run Code Online (Sandbox Code Playgroud)
如何arrayofa在构造函数中显式初始化B?