Right now i am having difficulty skipping the blank lines in the txt file i read in. I read in all the material i need, but the blank lines come in too and messes up my array.
this is my txt file
####
#M##
#..#
##.#
#..#
####
0
S
E
S
W
0
#include <iostream>
#include <fstream>
#include <cctype>
using namespace std;
int main()
{
ifstream dataFile;
dataFile.open("mice.txt");
char maze[10][10];
//char direction[10][1];
int i=0;
int j=0;
char output;
dataFile.get(output);
while(output != '0')
{
if(output != '0' && output != '\n')
{
maze[i][j] = output;
cout << maze[i][j] << endl;
j++;
}
else
{
maze[i][j] = NULL;
i++;
j=0;
}
//if(output == 'E' || output == 'S' || output == 'W' || output == 'N')
//{
// direction[m][n] = output;
// m++;
//}
dataFile.get(output);
}
for(int m=0; m<(i-1); m++)
{
for(int n=0; n<4; n++)
{
cout << maze[m][n];
}
cout << endl << endl;
}
dataFile.close();
return 0;
}