Why cant i use string instead of char for the user input in this function?
Thanks in advance!Code:ifstream* openFile(){
ifstream* file1 = 0;
for(;;)
{
char fileName[88];
cout << "Enter the name of your file: " << endl;
cin >> fileName;
file1 = new ifstream(fileName);
if (file1 -> good())
{
break;
}
cerr << "\nThere is no file, named --> " << fileName << " <-- in your folder.\n\n" << endl;
delete file1;
}
return file1;
}