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;

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

I am so sorry for not reading the older post and thank you. It worked.