S
saltedcoffee
hey, I am beginer to C++ programing.
I am working on a project called the "maze Problem"
First of all I am required to read a text file in( which is the maze)
and store it into a 2 dimentional vector.
This is what I have till now:
#include <iostream>
#include "maze.h"
#include <vector>
#include <fstream>
using namespace std;
int main()
{
typedef vector< vector<char> > vectorMaze;
//get the name of the file
ifstream mazeFile;
cout<< "Enter name of file name with the maze: "<<endl;
while(!mazeFile.eof())
{
getline(cin,vectorMaze);
}
I feel there are errors with the above attempt too, but I also don't
know how to put this input into a 2-d vector.
Any help would be appreciated.
Thanks......
I am working on a project called the "maze Problem"
First of all I am required to read a text file in( which is the maze)
and store it into a 2 dimentional vector.
This is what I have till now:
#include <iostream>
#include "maze.h"
#include <vector>
#include <fstream>
using namespace std;
int main()
{
typedef vector< vector<char> > vectorMaze;
//get the name of the file
ifstream mazeFile;
cout<< "Enter name of file name with the maze: "<<endl;
while(!mazeFile.eof())
{
getline(cin,vectorMaze);
}
I feel there are errors with the above attempt too, but I also don't
know how to put this input into a 2-d vector.
Any help would be appreciated.
Thanks......