if anyone can check out my program below and see whats wrong, itd be greatly appreciated.

my goal:
user input a text file (i.e. data.txt) to open and read
print the mssg within file to both console and text file (i.e. secret.txt)
print the mssg as scrambled message (ASCII)

my problem:
-- it doesn't print out the scrambled version.
it DOES print out scrambled letters that are within the "data.txt"
but it doesnt OPEN the data.txt file and print the mssg within the file. just the data.txt words.

any suggestions?

current program:

#include <fstream>
#include <iostream>
#include <string>
using namespace std;

int main()
  ifstream fin;
  string fileName;
  cout << "What file do you want to use for input? ";
  getline(cin, fileName);
  ofstream fout;
  fout.open("secret.txt", ios::app);
  if( !fin.is_open() )
      fout << "Can't open the file\n";
      return 1;
  string s;
  while (getline(fin, s))
    string s = "data.txt"; // an example
    for (unsigned int i = 0; i < s.length(); i++) // for each char in the string...
    s[i]++; // bump the ASCII code by 1 
    cout << s << endl;
    fout << s << endl;
  } //  while

  return 0;
This question has already been answered. Start a new discussion instead.