i am makign a huge list and the lsit goes off svcreen because its so big, i want to make a thing so liek after every ten lines the user has to press enter to view the next ten liens on the list
Printable View
i am makign a huge list and the lsit goes off svcreen because its so big, i want to make a thing so liek after every ten lines the user has to press enter to view the next ten liens on the list
Pesudocode.
Very simple stuff.Code:while( !atEndOfList( ) )
{
for( x = 0; x < outputsize; x++ )
{
outputData( list );
}
displayPausePrompt( );
}
Quzah.
here is par tof the list, i dont think u got wut i meant
PHP Code:
cout << "Snow is " << snow << endl;
cout << "Ghost White is " << ghostwhite << endl;
cout << "White Smoke is " << whitesmoke << endl;
cout << "Grainsboro is " << grainsboro << endl;
cout << "Floral White is " << floralwhite << endl;
cout << "Old Lace is " << oldlace << endl;
cout << "Linen is " << linen << endl;
cout << "Antique White is " << antiquewhite << endl;
cout << "Papaya Whip is " << papayawhip << endl;
cout << "Blanched Almond is " << blanchedalmond << endl;
// need something here so code stops and doesnt continue untill you press enter
cout << "Bisque is " << bisque << endl;
cout << "Peach Puff is " << peachpuff << endl;
cout << "Navajo White is " << navajowhite << endl;
cout << "Moccasin is " << moccasin << endl;
cout << "Cornsilk is " << cornsilk << endl;
cout << "Ivory is " << ivory << endl;
cout << "Lemon Chiffon is " << lemonchiffon << endl;
cout << "Sea Shell is " << seashell << endl;
cout << "Honey Dew is " << honeydew << endl;
cout << "Mint Cream is " << mintcream << endl;
// need something here so code stops and doesnt continue untill you press enter
cout << "Azure is " << azure << endl;
cout << "Alice Blue is " << aliceblue << endl;
cout << "Lavender is " << lavender << endl;
cout << "Lavender Blush is " << lavenderblush << endl;
cout << "Misty Rose is " << mistyrose << endl;
cout << "White is " << white << endl;
You could make it much easier to display text with a class and a loop.
And the press enter thing
stdlib.h
system("PAUSE");
try it
std::cout << "Press enter to continue." << endl;
std::cin >> tempvar;
Just use a cin line as per above. You should be able to do it without a variable even, but it's been a while since I played with C++ streams, so it eludes me.
Quzah.
tried that alreayd did work.]
Code:#include <iostream>
#include <fstream>
using namespace std;
int main(void)
{
cout <<"Press enter to continue" <<endl;
cin.get();
return 0;
}
is the world broken? nothing works!
You might need to clear the input buffer first, try looking up cin.ignoreQuote:
Originally posted by Klinerr1
is the world broken? nothing works!
Alright to just make it pause until you press enter use this simple statement its called getch(); or getchar(); if one doesn't work the other should and have a #include <conio.h> i think thats the right include just try it and out if it works then smile and keep making that program
best of luck (Snowy) :D
Include <conio.h> at the beginning of your program.PHP Code:
cout << "Snow is " << snow << endl;
cout << "Ghost White is " << ghostwhite << endl;
cout << "White Smoke is " << whitesmoke << endl;
cout << "Grainsboro is " << grainsboro << endl;
cout << "Floral White is " << floralwhite << endl;
cout << "Old Lace is " << oldlace << endl;
cout << "Linen is " << linen << endl;
cout << "Antique White is " << antiquewhite << endl;
cout << "Papaya Whip is " << papayawhip << endl;
cout << "Blanched Almond is " << blanchedalmond << endl << flush;
getch();
cout << "Bisque is " << bisque << endl;
cout << "Peach Puff is " << peachpuff << endl;
cout << "Navajo White is " << navajowhite << endl;
cout << "Moccasin is " << moccasin << endl;
cout << "Cornsilk is " << cornsilk << endl;
cout << "Ivory is " << ivory << endl;
cout << "Lemon Chiffon is " << lemonchiffon << endl;
cout << "Sea Shell is " << seashell << endl;
cout << "Honey Dew is " << honeydew << endl;
cout << "Mint Cream is " << mintcream << endl << flush;
getch();
cout << "Azure is " << azure << endl;
cout << "Alice Blue is " << aliceblue << endl;
cout << "Lavender is " << lavender << endl;
cout << "Lavender Blush is " << lavenderblush << endl;
cout << "Misty Rose is " << mistyrose << endl;
cout << "White is " << white << endl;
try system("pause");
u all must be using different compilers than I because the only working one is the pause. thanks!