Put A String In A ifstream Method [duplicate]
问题 This question already has an answer here : No matching function - ifstream open() (1 answer) Closed 5 years ago . I'm learning C++ and i'm getting some troubles when i'm trying to use a String in a ifstream method, like this: string filename; cout << "Enter the name of the file: "; cin >> filename; ifstream file ( filename ); Here is the full code: // obtaining file size #include <iostream> #include <fstream> using namespace std; int main ( int argc, char** argv ) { string file; long begin