I've been working on a little program for a while now, I recently added a piece of code that retrieves a file named 'Help.cryo' and displays all the contents (It just displays the available commands ). While this works fine; the problem occurs when I try to access it again.
I state it ifstream help ("Help.cryo");
I call the loop and the get the Help file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
do
{
if (help.is_open())
{
while ( help.good() )
{
getline (help,help_inline);
cout << help_inline << endl;
}
help.close();
}
else cout << "Help File can not be found.\n";
}
When I try to reopen it, it reads it can not be found. I feel like this is a simple problem but confusing to me. Any help would be lovely, thank you!