0

I have to open a file whose name i am constructing by concatenating various inputs from the user.
If I write:

string s = "filename.csv";
ofstream fout;
fout.open(s,ios::app);

it gives error for using s in fout.open(). It says it is a wrong form. I need to use a const char

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by sureronald
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.