cout << "Please enter the name for the input file: " << endl;
cin >> input_name;
cout << "Please enter the name for the output file: " << endl;
cin >> output_name;
input_stream.open(input_name);
if(input_stream.fail())
{
cout << "Error unable to open file input file" << endl;
exit(EXIT_FAILURE);
}
output_stream.open(output_name);
if(output_stream.fail());
{
cout << "Error unable to open output file" << endl;
exit(EXIT_FAILURE);
}
This program reads in some names from a file and formats them correctly but i can't get the output stream to open. I tried using a constant value for the output stream name and file name but it still didn't work. I created another test program to see if it was my computers permissions stoping the file from opening, but that wasn't the case since it was able to open the files fine. Please help me figure out how to open the output stream.