Right now, the output of my file automatically ends in ".txt" (which i want it to)
But, i also want the name to start with "C:/Documents and Settings/All Users/Desktop/"
How can I add that so "filename" automatically has that directery?
(Right now, if in the program, i manually type in C:/Documents and Settings/All Users/Desktop/NAMEOFFILE then it will work fine, but i want it to be in the program so i only have to type in NAMEOFFILE
Thanks,
Nate
int main()
{
char str[10];
char FileName[500];
char FileContents[5000];
cout<<"Enter The File Name\n";
cin.getline ( FileName, 500 );
cout<<"Enter The File Contents\n";
cin.getline ( FileContents, 5000 );
strcat( FileName, ".txt");
ofstream a_file ( FileName );
a_file<<FileCon tents;
a_file.close();
cout<< str <<"\n";
But, i also want the name to start with "C:/Documents and Settings/All Users/Desktop/"
How can I add that so "filename" automatically has that directery?
(Right now, if in the program, i manually type in C:/Documents and Settings/All Users/Desktop/NAMEOFFILE then it will work fine, but i want it to be in the program so i only have to type in NAMEOFFILE
Thanks,
Nate
int main()
{
char str[10];
char FileName[500];
char FileContents[5000];
cout<<"Enter The File Name\n";
cin.getline ( FileName, 500 );
cout<<"Enter The File Contents\n";
cin.getline ( FileContents, 5000 );
strcat( FileName, ".txt");
ofstream a_file ( FileName );
a_file<<FileCon tents;
a_file.close();
cout<< str <<"\n";
Comment