Re: Clearing the screen - Press any key...
From: Steve (aeroman10_at_nospam-yahoo.com)
Date: 09/01/04
- Next message: ranjeet: "Re: which is efficent for loop ??"
- Previous message: Ulrich Eckhardt: "Re: Clearing the screen - Press any key..."
- In reply to: Ulrich Eckhardt: "Re: Clearing the screen - Press any key..."
- Next in thread: Mike Wahler: "Re: Clearing the screen - Press any key..."
- Reply: Mike Wahler: "Re: Clearing the screen - Press any key..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 01 Sep 2004 06:20:32 GMT
Thanks, that worked...
Had a problem with that for a second but it was because I didnt have
#define<string>
-- Steve - A+, I-Net+ Free PC Tech Support - http://www.webzila.com DLL Files - http://www.dllplanet.com Live Support - http://www.webzila.com/livesupport "Ulrich Eckhardt" <doomster@knuut.de> wrote in message news:2pl3osFlbl0iU1@uni-berlin.de... > Steve wrote: >> //Sample code for pressing any key to continue... >> char anykey; >> cout << "Press any key to continue..."; >> cin >> anykey; >> cout <<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; >> //End sample >> >> So that code requires that you actually enter some character before >> pressing enter. How do you make it so that you can simply press the >> space bar and press enter to clear the screen? > > std::cout << "<enter>" << std::flush; > std::string str; > std::getline( std::cin, str); > >> Also is there a better way to clear the screen other than using >> \n\n\n\n\n\n\n\n\n\n (the method for clearning the screen must be an >> ANSI/ISO Standard C++ command/code). > > No, there isn't. > > For text-based, menu driven programs, you should take a look at one of the > curses libraries. They feature much more, e.g. tracking single keypresses > and positioning the cursor and are available for a wide range of > platforms. > > Uli > > -- > FAQ: http://ma.rtij.nl/acllc-c++.FAQ.html
- Next message: ranjeet: "Re: which is efficent for loop ??"
- Previous message: Ulrich Eckhardt: "Re: Clearing the screen - Press any key..."
- In reply to: Ulrich Eckhardt: "Re: Clearing the screen - Press any key..."
- Next in thread: Mike Wahler: "Re: Clearing the screen - Press any key..."
- Reply: Mike Wahler: "Re: Clearing the screen - Press any key..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|