hello everyone,
I am having a major problem with this assignment that asks to create a function whose input is a reference to an input file, which asks user to enter a file name to open for input, then checks to see where the file opened successfully.
the function returns nothing.
I tried implementing the code so far, however for some reason it doesnt even open a file. The file is saved in the same directory as the program. I have know idea whats going on. Please help!
#include<iostream>
#include<fstream.h>
#include<string>
using namespace std;
int main()
{
ifstream inFile;
string inFileName;
cout << "Enter a filename: ";
cin >> inFileName;
inFile.open(inFileName.c_str());
system ("pause");
return 1;
}