user input and reading from two txt files

i need help with having a user enter either
4-0.txt or 4-1.txt files

i need both files going to EX4outfile
i have all the calculations right for 4.0.txt when i enter it like this
infile.open("4-0.txt")
ex4file.open(ex4.txt)

but im not supposed to have the infile.open , its suppose to be from the user input as with the code below.

1
2
3
4
5
6
7
8
9
  cout << "Enter the name of input file to process" << endl;
	cout << "Select from these two file names:" << endl;
	cout << setw(15) << "Ex4-0.txt" << endl;
	cout << setw(15) << "Ex4-1.txt" << endl;


	cout <<"Enter the name of the input file:";
	cin >> fileName;
	
closed account (Dy7SLyTq)
infile.open(fileName);

if that doesn't work compile it with -std=c++11
Topic archived. No new replies allowed.