|
-
May 4th, 2009, 03:56 PM
#1
Problem with setting filename using a string...
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|