Hello, I've got a class Lattice which is declared like that:
// file: lattice.h
class Lattice:public EventChooser{
public:
Lattice(Lattice Parameters* params);
virtual ~Lattice();
// (...snip...)
private:
// How do I declare this member array in the lattice.h file?
// The following doesn't seem to work
LatticeSite** lattice; // does not compile
};
// file: lattice.cpp
Lattice::Lattic e(LatticeParame ters* params){
// Initializing 3D lattice
LatticeSite lattice[Ni][Nj][Nk];
for(int i=0; i<Ni; i++)
for(int j=0; j<Nj; j++)
for(int k=0; k<Nk; k++)
lattice[i][j][k].setValues(i,j, k,0);
}
The class LatticeSite has a default constructor.
So I don't know how to declare "lattice" which is an array of LatticeSite
objects in the file lattice.h.
Any ideas? Thanks Phil
Comment