I know there is many question talks about static function and variable but I can't find the one that explain me how do things like this:
board.h
class board:public QGraphicsPixmapItem
{
public:
board();
static basedice *gamepos[8][8];
};
and I want to defined my array like this:
board.cpp
board::board()
{
for (int i=0;i<8;i++)
{
for (int j=0;j<8;j++)
{
gamepos[i][j]=NULL;
}
}
}
And I have one more question,Is that a right way to use an array in many classes something like global array... for example in chess game for holding postion of my pieces? Sorry for my bad english.