#ifndef MAZE_READER
#define MAZE_READER
#include "MazeCreationException.h"
class MazeReader
{
public:
/**
* @post A MazeReader is created. A 2D char array is allocated with the maze information.
* @throws MazeCreationExecption
*
*/
MazeReader(std::string ifile) throw (MazeCreationException);
/**
* @post The maze is deallocated.
*/
~MazeReader();
/**
* @pre the file was formatting and read in correctly
* @return Returns pointer to the maze
*/
constchar* const* getMaze() const;
/**
* @pre the file was formatted and read in correctly
* @returns the number of columns listed in the file
*/
int getCols() const;
/**
* @pre the file was formatted and read in correctly
* @returns the number of rows listed in the file
*/
int getRows() const;
/**
* @pre the file was formatted and read in correctly
* @returns the starting column
*/
int getStartCol() const;
/**
* @pre the file was formatted and read in correctly
* @returns the starting row
*/
int getStartRow() const;
private:
/**
* @pre the file is properly formatted
* @post the characters representing the maze are stores
*/
void readMaze() throw (MazeCreationException);
};
#endif
---------------------------------------------------------------------------
I know most of my methods are not filled in I just started on this and I ran into a problem with the constructor or linking my MazeReader. I figured the MazeWalker code was irrelevant to my problem as there aren't any errors in it and it is even less complete than the MazeReader.
Anyway I was wondering what could be causing me to not be able to make an instance of my MazeReader class in my main.cpp
Any info would be greatly appreciated.
Thanks in advanced!
main.cpp line 8: You instantiate MyMaze using MazeReader's default constructor, but MazeReader has no default constructor.
main.cpp line 9: It looks like you want to invoke MazeReader's constructor that takes a string. That's not how you do it. Try this in place of lines 8-9: