I have an array that will have thousands of elements. I have a for-loop to print it out, but only 200 at a time.
To continue with the next 200, the user gets the text "Press enter to continue" and i use cin.get(); to pause right there.
The printing get aweful with a lot of "Press Enter to continue" here and there so i thought of using carriage return to overwrite "Press Enter to Continue" with some "======".
Unfortunately my program is not overwriting it when I use cin.get(); first.
Is there a way around this?
string pressEnter = "\nPress Enter to continue . . .";
string lineBorders = "========================================================================================================";
for (int *ia = arrayen, i = 1; ia < arrayenEnd; ia++, i++)
{
cout << setw(10) << *ia;
if (i > 9 && i % 10 == 0) {
cout << endl;
}
if (i > 199 && i < size && i % 200 == 0) {
cout << pressEnter << '\r' << flush;
cout.flush();
cin.get();
cout << lineBorders << endl;
}
}