I am trying to open a file using the following code,
but I am getting an error:Code:ifstream a_file ( "D:\\ LotteryProgram / MegaMill" ); //Opens MegaMill for reading the file if ( !a_file.is_open() ) { cout << " The file could not be opened" << endl; (a_file.open()); } else { cout << "Safely use the file stream" << endl; cin.get(); }
"Error 1 error C2661: 'std::basic_ifstream<_Elem,_Traits>:pen' : no overloaded function takes 0 arguments"
and I don't understand it. Why do I get an error when I tell the program to open a_file if it is not open? Can someone translate this error into English so I can make sense of it? ....therry