looping through a text file

im coding a maze using recursion and im having trouble getting the starting points from the bottom of the text file it works only because I have hard coded numbers in for texting purposes. My starting point function loops through just like my print function but im not sure as to how to get the the starting points I need

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
void printMaze(char maze[ROWS][COLS], int row, int col)
{
	for (int row = 0; row < ROWS; row++)
	{
		for (int col = 0; col < COLS; col++)
		{
			cout << maze[row][col] << ' ';
		}
		cout << endl;
	}
	cout << "Press Enter to continue";
	cin.get();
	cout << endl;



 void startingPoint(char maze[ROWS][COLS], int row, int col)
{
	for (int row = 0; row < ROWS; row++)
	{
		for (int col = 0; col < COLS; col++)
		{
			cout << maze[row][col]<< ' ';
		}
		cout << endl;
	}
	cout << endl;
}

int main()
{

	char maze[ROWS][COLS];

	string filename;
	string line;
	string start;
	int Num = 0;
	int startingRow = 0;
	int startingCol = 0;
	cout << " Please Select a Maze ";
	getline(cin, filename);
	ifstream file(filename, ios::in);
	if (file.is_open()) 
	{
		for (int row = 0; row < ROWS; row++) 
		{
			getline(file, line);
			for (int col = 0; col < COLS; col++)
			{
				
				maze[row][col] = line[col];
				maze[row][col] = line[col];
			}
		}
	}
	
	
	if (mazeEscape(maze, 1, 1))
		cout << "horray I'm Free" << endl;
	else
	/cout << "Help Im Trapped" << endl;

	system("pause");
	return 0;
}
Topic archived. No new replies allowed.