Maybe you need to learn File I/O with C++.
Basically you include <fstream> and create instances of fstream (for I/O), ifstream (for input only) or ofstream (for output only). Then you open a file and use the object as you usually do with cin/cout.
Here‘s a Google search. The first page contains a lot of useful tutorials. Follow one of them and you’ll be on your way soon.
1
solved Quicksort input text C++