title: problems with filestream, streamreader and streamwriter
body: <p>my first problem comes in the form of if i declare my filestream etc in this manner</p>
  
  <pre><code>filestream file;
  streamreader file_in;
  streamwriter file_out;
  
  try
  {
      file = new filestream("data.txt", FileMode.OpenOrCreate);
      file_in = new streamreader(file);
      file_out = new streamwriter(file);
  }
  catch(IOException exc)
  {
      Console.WriteLine(exc.Message);
  }
  </code></pre>
  
  <p>throws an error which says "use of unassigned local variable", which i find odd because all streams are declared outside of the try block but within the main so they should exist within the main.</p>
  
  <p>my other problem comes in the form that if i remove the try/catch block and just declare the streams as one line (eg: <code>FileStream file = new FileStream("data.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);</code>) my reading from file does work however i cannot write to file. my write to file function is as follows:</p>
  
  <pre><code>    public bool write_to_file(ref StreamWriter file_out)
      {
          if (this.is_empty == true)
          {
              Console.WriteLine("error, there is nothing to write.");
              Console.WriteLine("press any key to continue...");
              Console.ReadKey();
              return false;
          }
  
          try
          {
              string temp = this.is_empty + "," + this.movie_title + "," + this.year_released + "," + this.publisher + "," +
                  this.length + "," + this.acting_rating + "," + this.music_rating + "," + this.cinematography_rating + "," +
                  this.plot_rating + "," + this.duration_rating + "," + this.total_rating;
              file_out.WriteLine(temp);
              return true;
          }
          catch (IOException exc)
          {
              Console.WriteLine(exc.Message);
              Console.WriteLine("press any key to continue...");
              Console.ReadKey();
              return false;
          }
      }
  </code></pre>
  
  <p>any help would be much appreciated, thanks.</p>