input and output files

I am writing a program that prompts the user to enter a file to input to and then enter a file to output to. echoing the users choices back on the screen. then after to go through each file and search for & what can i change or need to do?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{

  string fileInput, fileOutput;

  string input = "";

  while (true)
  {
    ifstream fin;
    cout << "What file would you like to input to? [default: fileContainingEmails.txt]:  ";
    getline (cin, fileInput);
  
    if (input == "") 
      fin.open("fileContainingEmails.txt");
    if (input != "");
      fin.open(fileInput.c_str());

 
  while (true)
  {
    ofstream fout;
    cout << "What file would you like to output to? [default: copyPasteMyEmails.txt]:  ";
    getline (cin, fileOutput);

    if (input == "")
      fout.open("copyPasteMyEmails.txt");
    if (input != "");
      fout.open(fileOutput.c_str());
  

  if (fileInput == "")
    cout << "Input File: fileContainingEmails.txt" << endl;

  else
    cout << "Input File: " << fileInput << endl;

  if (fileOutput == "")
    cout << "Output File: copyPasteMyEmails.txt" << endl;

  else 
    cout << "Output File: " << fileOutput << endl;
 
  return 0;
}
}}

you are just opening the files successfully and showing their name on screen what else you want to do?
could not understand this line
then after to go through each file and search for & what can i change or need to do?
Topic archived. No new replies allowed.