i am supposed to use a switch statement to open 3 txt files.
i have txt;
txt1.txt
txt2.txt
txt3.txt
so for a switch to get user input.
//file number is the number the user entered either 1,2 or 3.
switch(fileNumber)
case'1':
case'2':
default:
how do i make it open the correct txt based on the user entering the 1,2 or 3 number.
std::vector filenames;
filenames.push_back("file1.txt");
filenames.push_back("file2.txt");
// Read user selection into i
// ...
// Open file
file.open(filenames[i]);