I want the user to input a file name and then the program reads from that file and does what it needs to do.
Code:
cin >> file;
ifstream bookmark (file);
Before I was just using
Code:
ifstream bookmark ("bookmarks.html")
but when I try and replace the actual file with a variable it gives me the error
Code:
.\CBookmarks.cpp(36) : error C2664: 'std::basic_ifstream<_Elem,_Traits>::basic_ifstream(const char *,std::ios_base::openmode,int)' : cannot convert parameter 1 from 'std::string' to 'const char *'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called