title: Program Almost Runs ,Trouble With File Operation
body: <p>The program almost runs but i am not sure how to make the .txt file for this , its not giving me an error.</p>
  
  <p>the project asks me to:</p>
  
  <p>" File encryption is the science of writing the contents of a file in a secret code. Your encryption program should work like a filter, reading the contents of one file, modifying
  the data into a code, and then writing the coded contents out to a second file. </p>
  
  <p>The second file will be a version of the first file, but written in a secret code. Although there are complex encryption techniques, you should come up with a simple one of your own. For example, you could read the first file one character at a time, and add 10 to the ASCII code of each character before it is written to the second file. "</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main()
  {
      char ch;
      fstream fin, fout;
      fin.open("testone.txt", ios::in);
      fout.open("encrypted.txt", ios::out);
  
      while (!fin.eof())
      {
          fin.get(ch);
          fout.put(ch + 10);
      }
  
      fin.close();
      fout.close();
      system("pause");
      return 0;
  }
  </code></pre>