i dont know how to initzalitze a 3d matrix.
Thats the 3d matrix of terminal class:
contenidor ***_terminal;
Thats the hpp of contenidor class:
class contenidor {
public:
contenidor(const string &m, nat l) throw(error);
contenidor(const contenidor &u) throw(error);
~contenidor() throw();
private:
string _m;
nat _l;
Thats how i try to initialize:
contenidor _terminal = new contenidor**[n];
for(int x = 0; x < n; ++x) {
_terminal[x] = new contenidor*[m];
for(int y = 0; y < m; ++y) {
_terminal[x][y] = new contenidor[y];
for(int z = 0; z < h; ++z) {
_terminal[x][y][z] = 0;
}
}
}
Errors displayeds from terminal:
terminal.cpp: In constructor ‘terminal::terminal(util::nat, util::nat, util::nat, terminal::estrategia)’:
terminal.cpp:33:43: error: no matching function for call to ‘contenidor::contenidor()’
_terminal[x][y] = new contenidor[y];
^
terminal.cpp:33:43: note: candidates are:
In file included from terminal.hpp:9:0,
from terminal.cpp:1:
contenidor.hpp:16:3: note: contenidor::contenidor(const contenidor&)
contenidor(const contenidor &u) throw(error);
^
contenidor.hpp:16:3: note: candidate expects 1 argument, 0 provided
contenidor.hpp:14:3: note: contenidor::contenidor(const string&, util::nat)
contenidor(const string &m, nat l) throw(error);
^
contenidor.hpp:14:3: note: candidate expects 2 arguments, 0 provided
terminal.cpp:35:8: error: ‘array’ was not declared in this scope
array[x][y][z] = 0;
^