output stream creates the txt file but won't open

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <iomanip>
#include <ctype.h>
#include <cstdio>
using namespace std;

void name_organizer(ifstream& input_stream, ofstream& output_stream);


int main ( )
{

ifstream downstream;
ofstream upstream;

name_organizer(downstream, upstream);

return 0;

}


void name_organizer(ifstream& input_stream, ofstream& output_stream)
{
char input_name[33], output_name[33],storedvalue[33], c, w;


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);
}

while (!input_stream.eof())
{


input_stream.get(c);
if (isdigit (c))
{
input_stream.putback(c);
input_stream >> storedvalue;
cout.setf(ios::right);
cout << endl << setw(4) << storedvalue << " ";
cout.unsetf(ios::right);
}
else if (isspace(c))
{
w = 1;
}
else
{
input_stream.putback(c);
input_stream >> storedvalue;
cout.setf(ios::left);
cout << setw(12) << storedvalue;
cout.unsetf(ios::right);
}



}

cout << endl;
input_stream.close();
output_stream.close();

return;
}

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.
Could it help to actually write something to the stream?
Topic archived. No new replies allowed.