i have lately been running into lots of problems where i have a "string" and the items needs a "char" or vise versa, i have been trying to stay to "strings". I also think it has to do with the calls im using are old calls using the "char".
any help on how to open the file correctly with what i am using or if im using the wrong call to open the file a replacement
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string fileName;
cout << "Please enter file to open:";
cin >> fileName;
ifstream fin;
string szLine = "";
fin.open(fileName); // this is where my problem stems from
if (fin.fail())
{
cout << " could not find filename\n";
return -1;
}
while (getline(fin, szLine))
cout << szLine;
fin.close();
system("pause");
return 0;
}