Ok i got a problem with trying to read off a file that doesnt exist yet something like this
string fname; ifstream InObj; cout << "Enter name of file name: "; cin >> fname; InObj.open(fname);
Then i got this error:
N:\VC++\LAB01A\F06Lab1a.cpp(97) : error C2664: 'void __thiscall std::basic_ifstream<char,struct std::char_traits<char> >::open(const char *,int)' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std
::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
I try it with Char and it seem to work but when running the program it seem to skip that part... or something the program pop up with a window with option of fixing bug or closing it.
Is there anyway of reading a file as u enter?