I want to use the string - filename , as the file name, but I can't get it to work...
How can I do this???


I would also want to add Input to the file, where it says File Info, how would I do this...


#include <cstdio>
#include <iostream>
#include <stdlib.h>
#include <string>

using namespace std;

int main()
{
{
string filename;
cin >> filename;
cout << filename;
}
FILE * file = fopen("This is where I want my string name" , ".dat","w");
fprintf(file, "File Info");
fclose(file);
system ("PAUSE");
return 0;
}

Any info. would be helpful...