Hi there, welcome to the forums. I'll give you a few ideas here, and you can think about which best suits your needs, and then we can go from there. I am assuming that this is a console application (i.e. doesn't have a GUI as part of the programme).
So, if I understand correctly, what's happening is your programme spurts out text all over the screen, and pretty soon it runs off the bottom of the screen and you get several pages of it, and you want this to not happen.
Firstly, do you need to see the output whilst the programme is running and make decisions based on it that will affect the programme? If not, I would advise that you don't output your text to screen, but to a log file. Then, when the programme is finished, you will have a simple text file that you can open with your text editor of choice, and examine all of it for as long as you like.
If you need to see it on screen, you will need to take better control of the output. One option is to have all the output stored in a buffer (or some other mechanism by which you can count how much has been put to screen), and then have another piece of code that reads from the buffer until it has printed out one screen's worth, and then to wait for you to do something to indicate that you have read it, and then it will carry on. The issue here is that you will then be pausing the programme every time the screen output pauses. If you need the programme to keep running and not pause every time the screen fills, you might have to consider using threads. This is not nearly so tricky as it might sound, but is a little more complex, obviously, than not using threads.
\\random code
cout << "press enter to goto next page" << endl;
cin.ignore()
\\more code
cin.ignore();
\\more code
cin.ignore()
you could just do that, and depending on what your program is used for you could also use
system("cls") (for windows) to "clear" the last page, but only use system() if your just coding for fun or for private use (meaning if you plan on coping it for others to use than DON'T use system()