This is either a very silly mistake which is staring me in the face,
or something weird...
in maze.h:
class MazeField : public QWidget {
Q_OBJECT
public:
MazeField( QWidget *parent=0, const char *name=0 );
QSizePolicy sizePolicy() const;
(...)
int ** Log;
void MazeField::intialiseLog();
(...)
};
in maze.cpp:
int NUMBER_OF_COLUMNS = 4;
int NUMBER_OF_ROWS = 10;
(...)
// Used at initialisation
void MazeField::intialiseLog() {
Log = (int **) calloc ((NUMBER_OF_COLUMNS + 1), sizeof(int *));
for (int col = 0; col < NUMBER_OF_COLUMNS; col++) {
Log[col] = (int *) calloc ((NUMBER_OF_ROWS + 2), sizeof(int));
}
Log[0][0] = 3;
Log[0][5] = 5;
for (int row = 0; row < NUMBER_OF_ROWS; row++) {
for (int col = 1; col < NUMBER_OF_COLUMNS; col++) {
cout << Log[col][row];
}
cout << endl;
}
exit(0);
}
It outputs :
000
000
000
000
000
000
000
000
000
000
And I've been unable to make it output any number except zeros...
Mariane
Bookmarks