press enter to continue

This is a discussion on press enter to continue within the C++ Programming forums, part of the General Programming Boards category; i am makign a huge list and the lsit goes off svcreen because its so big, i want to make ...

  1. #1
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608

    press enter to continue

    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
    Email: Klinerr1@nc.rr.com || AIM: MisterSako || MSN: sakotheinsane@hotmail.com

    -the shroom has spoken

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Pesudocode.
    Code:
    while( !atEndOfList( ) )
    {
        for( x = 0; x < outputsize; x++ )
        {
            outputData( list );
        }
        displayPausePrompt( );
    }
    Very simple stuff.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    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
    Email: Klinerr1@nc.rr.com || AIM: MisterSako || MSN: sakotheinsane@hotmail.com

    -the shroom has spoken

  4. #4
    . Driveway's Avatar
    Join Date
    May 2002
    Posts
    469
    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

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    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.
    Hope is the first step on the road to disappointment.

  6. #6
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    tried that alreayd did work.]
    Email: Klinerr1@nc.rr.com || AIM: MisterSako || MSN: sakotheinsane@hotmail.com

    -the shroom has spoken

  7. #7
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Code:
    #include <iostream>
    #include <fstream>
    
    using namespace std;
    
    int main(void)
    {
    	cout <<"Press enter to continue" <<endl;
    	cin.get();
    
    	return 0;
    }
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  8. #8
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    is the world broken? nothing works!
    Email: Klinerr1@nc.rr.com || AIM: MisterSako || MSN: sakotheinsane@hotmail.com

    -the shroom has spoken

  9. #9
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by Klinerr1
    is the world broken? nothing works!
    You might need to clear the input buffer first, try looking up cin.ignore
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  10. #10
    Registered User snowy101's Avatar
    Join Date
    May 2002
    Posts
    22

    i got tha answer

    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)
    Simple Programming

    :::: Error Message != A Smile ::::

  11. #11
    Seņor Member
    Join Date
    Jan 2002
    Posts
    561
    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
    Include <conio.h> at the beginning of your program.

  12. #12
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    try system("pause");

  13. #13
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    u all must be using different compilers than I because the only working one is the pause. thanks!
    Email: Klinerr1@nc.rr.com || AIM: MisterSako || MSN: sakotheinsane@hotmail.com

    -the shroom has spoken

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need Help With a BlackJack Program in C
    By Jp2009 in forum C Programming
    Replies: 15
    Last Post: 03-30-2009, 11:06 AM
  2. Header File Question(s)
    By AQWst in forum C++ Programming
    Replies: 10
    Last Post: 12-23-2004, 11:31 PM
  3. Enistine program
    By Mac_the vamp in forum C Programming
    Replies: 2
    Last Post: 11-11-2002, 10:56 AM
  4. help on pressing enter to continue
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 10-06-2001, 12:08 PM
  5. Pause or press any key to continue
    By muffin in forum C Programming
    Replies: 3
    Last Post: 09-12-2001, 01:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21