This is part of a much larger code but its supposed to do in steps
1]use ifstream take text from a user-specified file
2]store that text as a string
3]close ifstream and use ofstream to export the string to another file
I have a problem because I've tested it a bunch of times but the string seems to never get saved to the new file.
Code:
//*******************DATA CONVERSION******************
if(ans == 3){
ans = 0;
cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
//Reading Data
ifstream inputFile;
cout<<"Data File Name: "; cin>>filename;
inputFile.open(filename);
cout << "\nReading Data From " << filename << "...\n";
inputFile.getline(data_input, 1000);
inputFile.close();
//write to data to new file
cout<<"Output Data To File: "; cin>> exportfilename;
ofstream outputFile(exportfilename, ios::app);
outputFile.open(exportfilename);
cout << "\nWriting To " << exportfilename << "...\n";
outputFile << data_input;
outputFile.close();
system("pause");
goto main;
}