(a) class BinStrTreeNode {
public:
// ...
private:
string _value;
int _count;
BinStrTreeNode *_leftchild;
BinStrTreeNode *_rightchild;
};
(b) class BinStrTree {
public:
// ...
private:
BinStrTreeNode *_root;
};
(c) class iMatrix {
public:
// ...
private:
int _rows;
int _cols;
int *_matrix;
};
(d) class theBigMix {
public:
// ...
private:
BinStrTree _bst;
iMatrix _im;
string _name;
vectorMfloat> *_pvec;
};
Упражнение 14.15
Нужен ли копирующий конструктор для того класса, который вы выбрали в упражнении 14.3 из раздела 14.2? Если нет, объясните почему. Если да, реализуйте его.
Упражнение 14.16
Идентифицируйте в следующем фрагменте программы все места, где происходит почленная инициализация:
Point global;
Point foo_bar( Point arg )
{
Point local = arg;
Point *heap = new Point( global );
*heap = local;
Point pa[ 4 ] = { local, *heap };
return *heap;
}