one of my class is already declaring the variable to open the file, now that i need to called it in main class. I couldn't find a way to do so, can someone please give me some hint to call it.
Here is what it declare in the class.
Maze::Maze(const string& fileName):
maze(0), // init maze
rows(0),
cols(0),
mouseRow(0),
mouseCol(0),
cheeseRow(0),
cheeseCol(0),
squaresVisited(0)
{
// declare variable to open file etc.
ifstream inmaze(fileName.c_str());
if (inmaze == 0)
{
cerr << "Couldn't open maze file " << maze_file << endl;
return;
}
.......
in main
int main()
{
// i tried to call the maze class, but it said there is no default constructor
}
thx in advance