Hello Stack Overflow Community!
I'm currently having trouble using ifstream to take out two int values from a .txt file. My end goal is to have the first two values [6] [4] as two integers called xSize and ySize.
The file's contents are;
6 4 0 0 1 0 0 0 2 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 3 0
it's stored on an external USB with the location D:\Maze.txt and currently, when I check the value of the int at runtime the xSize value gets changed to 0 and the ySize doesn't change.
Any help on this would be massively appreciated!
Thank you!!!!!
void imp()
{
//Test Case
//6 4 0 0 1 0 0 0 2 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 3 0 0 0 0 0 3
int xSize; //Size of X Col
int ySize; //Size of Y Col
std::cout << "Import Begins\n" << std::endl;
std::ifstream inFile;
inFile.open("D:\Maze.txt");
//Error Checker
if (inFile.fail())
{
std::cout << "Error importing file.";
}
//Import Complete now to fill our vaulues
inFile >> xSize >> ySize;
inFile.close();
}