Start C++ course.
Don't expect that everything will be explained in QA.
This is *solo*learn. You need to show some effort from your side.
asking random question without trying to search answer on your own won't help you to learn.
The data produced or required should be permanently stored in memory.
The variables end it's life when the program get finished. That's why you should store it in file.
Here file handling comes into action.