Hi, I need to know how could I use the class ifstream if I want to pass a string to its constructor?
For example, if I have the following codes:
string name = "file.txt";
ifstream f(name);
the compiler says that ifstream doesn't take string as an argument, so what do I need to do to use the above codes? I don't want to use ifstream f("file.txt") ;
Thanks
For example, if I have the following codes:
string name = "file.txt";
ifstream f(name);
the compiler says that ifstream doesn't take string as an argument, so what do I need to do to use the above codes? I don't want to use ifstream f("file.txt") ;
Thanks
Comment