this thing gives me an error...Code:#include <fstream>
#include <string>
// ...
string address = "";
// ...
int main()
{
ifstream file;
cout << "enter file address:\n";
cin >> address;
file.open(address);
//...
}
Printable View
this thing gives me an error...Code:#include <fstream>
#include <string>
// ...
string address = "";
// ...
int main()
{
ifstream file;
cout << "enter file address:\n";
cin >> address;
file.open(address);
//...
}
open takes a const char * variable, not a std::string ... use string::c_str()
Code:file.open(address.c_str());
thank you for the quick response, im having such a crappy day... -____-